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