another fix for #119 (EOFError in __del__)