Fix a DDMS thread monitoring crash.

We changed the order of events during thread attaches, which means
it's now possible to have Thread structs with null threadObj fields.
This bit of code didn't change with the times, which made it possible
for a process being watched by DDMS to crash if we grabbed the thread
state at just the wrong time.

(cherry-pick from dalvik-dev)

Change-Id: Icd7f523ee8327f00693e601c1c82d3a8defb247f
1 file changed