Ensure flip function is executed before another thread accesses stack

Currently, it's possible that some thread running checkpoint or
Thread::GetPeerFromOtherThread accesses another thread's thread-local
data structures while the flip function is pending. This would result in
accessing from-space referenes.

Test: art/test/testrunner/testrunner.py --host
Bug: 263557041
Change-Id: Ib79fe7155f1e1345c72aa39f2a6eb742ed1265f1
6 files changed