Avoid race on Thread::tlsPtr_::top_handle_scope.

Require mutator lock for that field and update tests to hold
the mutator lock when needed. This prevents GC thread that
executes a thread roots flip on behalf of suspended threads
from racing against construction or destruction of handle
scopes by those threads and possibly seeing invalid values.

(cherry picked from commit 1d326f94a3fdd6292ccdf0022cedfb2a2b8acfee)

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 189439174
Merged-In: I268a0ef6e5aa838347956febca0d3b6e02fe3ae5
Change-Id: If4cdcf4a488e77cb5aa7748de7c77c49f04388b0
6 files changed