Merge "Don't corrupt the thread list if the main thread exits."