a80bd1a630
A rare race during shutdown. The contenders are the log thread coming out of its loop and calling errlogCleanup(), and the exitHandler signaling waitForWork. This solution is to move cleanup completely into exitHandler, which already waits for the log thread to exit.