Ensure thread_list_lock_ is correctly locked

We were incorrectly disallowing the thread_list_lock_ on the
InstrumentThreadStack function and not holding it for long enough in
some other situations. This meant we could have hit issues where
threads die in unexpected situations.

Test: ./art/test.py --host -j50
Test: ./art/tools/run-jdwp-tests.sh --mode=host
Bug: 34414073
Bug: 62821960
Change-Id: I91f5daa59cca4aaf3a73e860f68bb01c9ec0a47f
4 files changed