Reland of Reimplement AccountManagerHelper singleton instance creation

Original CL: http://crrev.com/2747293005

Current implementation of AccountManagerHelper can instantiate wrong delegate
type if get() is called in too early. This CL fixes it. AtomicReference is used
to avoid relying on external synchronization, because get() can be called
from different threads. This CL also adds
AccountManagerHelper.resetAccountManagerHelperForTests method that makes sure
there's no interference between tests.

BUG=698258,710901
TBR=rogerta@chromium.org

Review-Url: https://codereview.chromium.org/2836373003
Cr-Commit-Position: refs/heads/master@{#467619}
23 files changed