fix compile failure with MinGW toolchain

PR: 46175 (this is but a small part of the patch)
Submitted by: Carlo Bramini
Reviewed by: trawick

Backport of r1083038 from trunk.

fix a bit of 'if FOO'/'ifdef FOO' confusion

Backport of r1086695 from trunk.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1528889 13f79535-47bb-0310-9956-ffa450edef68