Fix -Wundef warnings for MINGW_HAS_SECURE_API