Some cross-platform code cleanups.

Fixes for MinGW and clang with HS_DEBUGGING enabled.
This is not correct. Building an Internal client now leads to the call of `_CrtDbgReport' in Line #125. However, that function is not defined when not building in Debug mode and we get a compiler error.