Fix reference counting in get_attached_entry (again)
When get_attached_entry() encounters entry that would be expired, it needs to get reference to the entry before calling maybe_expire_entry(), so the ADB entry doesn't get destroyed inside the its own lock.
This creeped into the code base again during review, so I am adding an extra comment to prevent this.
Closes #3712 (closed)