Revert^2 "[metrics] Add background reporting thread"

This adds a background thread that reports metrics every N seconds,
where N is specified by the -Xmetrics-reporting-period command line
option. Periodic reporting is disabled by default.

This reverts commit 73366109eec37b75f77f24e6e52832047508b34f.

The reason this was previously reverted was due to failures where
JVMTI reported an unexpected thread at startup. This change fixes the
issue by adding the metrics background reporting thread to the list of
allowed threads in ti_thread.cc.

Test: test/run-test --host 2233-metrics-background-thread
Test: adb shell stop && \
      adb shell setprop dalvik.vm.extra-opts \
          -Xmetrics-reporting-period=30\\\ -Xwrite-metrics-to-log && \
      adb shell start && \
      adb logcat  # observe metrics in log
Change-Id: I5eea4a4551de9cf4672a461c09521ef871063a91
16 files changed