runtests.pl: Modularization of MinGW/Msys compatibility functions