mingw: fix isatty() after dup2()