Better detect PrimitiveArrayCritical issues

Crash if we exit a thread while holding an unreleased
PrimitiveArrayCritical.

Report that we're in such a "critical section" as part of the thread
state.

Bug: 231038541
Test: Build and boot AOSP
Change-Id: I8b76ca6f7b5ca79712b2431d60ad5e6795e484a6
2 files changed