Fix reference to object after destruction
The returned reference to the object could be deleted in the case the
account was kept in the local list. This patch makes sure the returned
reference always references an object in the object container where
the objects reside.
BUG: 374526
FIXED-IN: 4.8.1
(cherry picked from commit 0d069938cfe325bb4cca28bfde5432a49ab8cbf8)