Work around lack of thread-safe static initialization on MSVC and Intel compilers