Fix the race condition detection in CentralAuthUser::attach

This is needed as the state of the central auth Database object
is being changed by the call to CentralAuthUser::invalidateCache.

Change-Id: I01a5e4dd0940982c957f0b7c7266f29f441a64e7
(cherry picked from commit 5f9fad67d2ad9178ae30f4b9c315e2026a806e47)