Make sure workers and nested workers are terminated correctly.
Created attachment 29567 [details]
The following illustrates how we shut down nested worker and worker:
1) When a worker is terminated, WorkerThread::stop() is called. If there exists nested workers, we will try to stop nested workers first. This is done by calling m_workerContext->stopActiveDOMObjects().
2) When the nested worker thread is tearing down and nested worker context is destroyed, WorkerMessagingProxy::workerContextDestroyed is called. From here, the parent worker context is notified.
3) When the parent worker context does not have nested worker threads running any more, it starts to shut down its own worker thread.