fails:IO#external_encoding raises an IOError on closed stream
