Fixes server shutdown on Windows.