Bug 966231. Allow blocking in a nested event loop even if the thread is being shut down. r=bsmedberg

--HG--
extra : rebase_source : 45654f14cb9a47b285b8491304de71a762132ac8