Some cross-platform code cleanups.

Fixes for MinGW and clang with HS_DEBUGGING enabled.
Two lines above the diff is `#if defined(HS_DEBUGGING) || !defined(PLASMA_EXTERNAL_RELEASE)`