Pass through information on the connection state.

Useful for being able to close the connection from functions
that return streams.
Add a callback for open/close/error events.

This also suppresses exceptions that are thrown during the
course of normal operation, such as Lwt.Closed (for regular
connection shutdowns), and End_of_file (when the browser
disconnects without completing the closing handshake).

Additionally, FDs no longer leak after a connection is terminated.
More robust handling of closes.

User-invoked closes will trigger an EBADF from a channel and
call close again for the exception; handle both cases.