Fix race condition in OAuth token status save

On Chrome OS, during a session restore,
|OAuth2LoginManager::OnSessionMergeSuccess| transitively sets the token
status as valid.

|AuthSyncObserver::HandleAuthError| sets the token status as invalid if
the token was in a persistent error state, but does not correct it if
the token status changes later.

There is no connection (from a flow of control perspective) between
these two entities and they are free to race.

In certain cases, it *can* happen that |AuthSyncObserver| gets the
status of an old invalidated token and marks it as invalid *after*
|OAuth2LoginManager| has marked the new token as valid.
|AuthSyncObserver| corrects for this behaviour for supervised accounts.
Make it work for all account types. This is a speculative fix for the
attached bug.

Bug: 952570
Change-Id: Ic1b3b0fe44bfec57495fcc8ecf5617c7b8fd7dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1665940
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Kush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670890}
2 files changed