reland: Moves loading of local_state and field trials to early initialization

Original is here: https://chromium-review.googlesource.com/c/chromium/src/+/882558

This differs from the patch that landed in two ways:
1. I completely misunderstood RunsTasksInCurrentSequence(). It may be
   called on any thread and basically comes down to checking if the
   current thread matches the thread the TaskRunner runs on. Changed
   implementation of DeferredSequencedTaskRunner and
   DeferringTaskRunner appropriately (added test for this).
2. Master prefs need ResourceBundle loaded with the data pack, so,
   shuffled around loading of that. This is covered by browser_tests
   that sadly only run on official builder.

There are two motivations for this change:
1. In order to run a field trial for state setup in creating toolkit.
2. To have local state ready at the time ash is created.

In order to have field trial ready I need to load local state and
everything it touches. This ended up including ResourceBundle (not
really the ResourceBundle, but the ResourceBundle code is used to
determine the locale, and the locale is needed by code related to
metrics, specifically ChromeMetricsServiceClient::GetApplicationLocale).

As much of this code was previously created at a time when task runners
were available I had to create a deferring task runner that queues up
tasks and then flushes them when the real task runner is available.

I've tried to only move what is necessary and leave as mush
initialization as possible in the place before this change.

You'll notice this creates g_browser_process early on. I explored not
doing this, but it turns out very painful as instead some code then
has to cache state that is later available in g_browser_process. The
camel that broke the straws back was the application locale. See
https://chromium-review.googlesource.com/c/chromium/src/+/853300 for
the early approach.

BUG=800358
[email protected],[email protected],[email protected]

Change-Id: I3343e8959321900daec0de16f6a86715d3760f29
Reviewed-on: https://chromium-review.googlesource.com/898070
Commit-Queue: Scott Violet <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#533989}
23 files changed