fails:IO#internal_encoding raises an IOError on closed stream
