Android: Add support for TraceEvent before the native library is loaded.

Currently TraceEvents recorded before the native library load are
silently discarded. This CL adds support for such "early" events.

The events are buffered in Java, and then sent to the native side once
it is available. This support is intentionally simple now. The aim is to
ease performance investigation of early startup, and to ease tracking of
early startup performance regression, since timings are then accessible
to TBM tests.

Also use the newly-introduced events in a couple places, and fix a bug
in the TraceEvent we use to record the launcher activity lifetime (when
an Activity calls finish from onCreate(), onPause() is not called).

BUG=564041

Review-Url: https://codereview.chromium.org/1486053003
Cr-Commit-Position: refs/heads/master@{#404635}
10 files changed