windows: rework the code to handle Xbox runtime limitations
Rework the code introduced in 105babe3. It was not playing nice with the rest of the code.
We use a standard define from the toolchain/Platform SDK to avoid calling code that won't link on Xbox. We can also use that define in other MSVC/clang-cl builds to make sure we keep compatibility.
mingw-w64 doesn't know about _CRT_DECLARE_NONSTDC_NAMES
so it's not usable in our usual builds.
Edited by Steve Lhomme