Fix static initialization
The thread-safe static access code of Visual Studio 2017 15.9.4 fails with a write access exception in Debug config otherwise.