Fixed for cygwin

In non-standard terminal such as mintty and cygwin, because it detects the pipe
incorrectly, also check named pipe.