Acquire the current timestamp within the procstats lock.

This CL fixes the race condition, where timestamps could be acquired
before going to the procstats-locked code section, while the ordering
of entering the code section isn't guaranteed anyhwere, thus a call
into procstats with an earlier timestamp could happen after a call
with a later timestamp, thus confuses the bookkeeping of procstats.

Bug: 194991626
Test: CtsAppTestCases
Change-Id: I8863c3738a97a4fcce881cb21f1db4df559a7b6b
8 files changed