fails:IO#tty? raises IOError on closed stream
