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

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

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