Oilpan: The main thread should not get involved in a GC after starting a shutdown sequence

This is a speculative fix for the following crash in build bots. This crash is flaky and I cannot reproduce it locally:
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Oilpan/builds/3338/steps/webkit_unit_tests/logs/stdio

As far as I see the stack trace, I guess that we're flakily hitting the following scenario:

(1) The main thread disposes V8.
(2) The parser thread has some tasks to be processed.
(3) The main thread calls HTMLParserThread::shutdown(). HTMLParserThread::shutdown() posts a shutdown task to the parser thread and then call TaskSynchronizer::waitTaskUntilCompleted(). The main thread enters a safe point scope.
(4) The parser thread processes some task (before processing the shutdown task) and triggers a GC.
(5) The main thread gets involved in the GC.
(6) The main thread calls ~XMLHttpRequest(). ~XMLHttpRequest() calls ~ScriptValue() which touches V8 APIs. Sicne V8 is already disposed, it crashes.

The issue is that the main thread gets involved in a GC after starting the shutdown sequence. To avoid that, this CL detaches the main thread from oilpan before the main thread starting the shutdown sequence.

BUG=340522

Review URL: https://codereview.chromium.org/223733002

git-svn-id: svn://svn.chromium.org/blink/trunk@171258 bbb929c8-8fbe-4397-9dbb-9b2b20218538