Fix a crash when canceling the model saving dialog on Windows.