MINGW: Define variable based on ABI check instead of compiler id
The `MINGW` variable indicates that the compiler targets MinGW, a GNU ABI on Windows. Since the compiler's target may be affected by flags known only after compiler identification, delay defining the `MINGW` variable until the ABI detection step. Also remove the now-unused undocumented `CMAKE_COMPILER_IS_MINGW` internal variable. Fixes: #22647