minor cleanup of Thread::WaitForDoneWhilePumpingMessages ()