Make RunAgentThread ensure thread attach is possible.

We need to ensure that we will be able to actually attach a thread
before we try to create the new agent thread. Previously we were
simply asserting that Attach succeeds and returning instantly. This
could lead to CHECK failures if we were unlucky enough to race with
the runtime destructor.

Test: ./test.py --host -j50
Bug: 68052586

Change-Id: Ib303260f4029346bb0c52c969c69ac54f14cce22
1 file changed