fix broken cygwin logic; fix cmd.exe fallback