Changing standard input detection from fstat to istty

because

* it's supported by MSYS