Add missing cont qualifier to compile-time constant.
Enable a math function available in all modern versions of MSVC.
Save a new configuration flag to indicate whether to use the synchronization functions in Windows Vista.

MSVC is infamous for not providing thread-safe initialization of local static objects before November 2013.
The Vista synchronization functions implement double-checked locking and serve as a fast-enough, safe workaround.
Reworked thread-safe creation of the global thread pool.

Under MSVC even a local static smart pointer was not initialized in a thread-safe way.
When not using neither a C++14 conformant MSVC nor the Vista sync functions, falls back to a function-level lock.
Explicitly include <algorithm> when using min/max; remove some blanket use namespace std.

Not including <algorithm> seems a major cause of failed compilation in MSVC 2013.
Improved singleton creation in Windows.