Change PlatformWindows.cpp to make sure that finalize() is called when clean shutdown is desired.