Fix shutdown on Windows.