am 39ce2282: Merge "Only detach shutdown thread if we attached it"

* commit '39ce2282ed2b020e51e8d92f442b419ae9dd6434':
  Only detach shutdown thread if we attached it