Some cross-platform code cleanups.

Fixes for MinGW and clang with HS_DEBUGGING enabled.