- Cleaning up file descriptor closing code (suggestion from
   takluyver)