Only detach shutdown thread if we attached it

Speculative fix to:
"Request to unregister unattached thread" bug.

Bug: 18713034
Change-Id: I6e69088dd66970c704010397a11e3758cf107ff9
1 file changed