Moved execution of on_close hooks to before closing, allowing a call to
Unix.descr_of_*_channel without raising an exception.