mingw: detect when MSYS2's sh is to be spawned more robustly