Add tests for Connection.is_alive(), fix wait-close issue

Fixed a bug where methods hang if a connection.close is received. We should
always check for an incoming connection close as well as a channel close.