Fix command not returning with recent mingw64

This should address both problems reported at gh-1544