Do not raise exceptions when stdio is closed 

Question was calling methods on nil and `Errno::EIO` was raised.

This way you can properly handle `Interrupt` exception.