Fixes around flushing per-thread tracing buffer am: 5c4f3e5e8b

Original change: https://android-review.googlesource.com/c/platform/art/+/2979435

Change-Id: I29036ffeae8b88ff384ed6730e15e292807d755d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>