Apparently MSVC doesn't support thread-safe static local initialization. Roll our...