fails:IO#isatty raises IOError on closed stream
