python uses _POSIX_THREADS to decide if it uses posix or nt threads,
but _POSIX_THREADS get included all the time by header includes
(pthread, unistd) in mingw. This was already patched but py3.7 added a new
header with a similar check which was missing.
This resulted in a mix of ntthread/posix api usage an crashes.
With non-mingw builds POSIX_SEMAPHORES_NOT_ENABLED is not enabled and
sem_unlink is a no-op. Change it to always be provided on Windows instead.
This adds a minimal test suite which makes it easier to catch regressions
in the future for common MSYS2 related bugs.