Use InitializeCriticalSectionEx for Windows Store or Windows Phone apps

The old InitializeCriticalSection function isn't available in
these API partitions, and the new InitializeCriticalSectionEx
function is only available since Vista, so we want to keep using
the old function for normal desktop code.
Enable use of D3D9 only when targeting desktop apps

Don't try to build this when building for phone/windows store (aka
metro/winrt) apps - this API isn't available there.
Use the right data type for process affinity mask

This allows using the same code on 64 bit windows as well.

Tested on MSVC 2008-2013.
Don't call process affinity functions in windows store or windows phone apps

These functions are only available in the desktop api subset.