Enable thread exit checks for bionic

We expect that thread was detached before exiting so we can properly
clean up the thread list. If the thread wasn't detached, then we may have
already exited threads in our thread list and access structures like
pthread_self which are no longer valid. For non-bionic we have check
that the thread was detached before exiting. This CL extends this check
for bionic too.

Bug: 376715376
Test: art/test.py
Change-Id: Ic12ba2d1e72f6cf76e6103e1332f71a5e37223b4
2 files changed