Fix closing connection while a channel is still open

Previously, this code would get stuck in a recursive loop trying to send
ChannelClose over a dead connection. This will ensure it tries to send
it at most once before realizing the connection is dead and stopping.
Merge pull request #230 from ContextLogic/close

Fix closing connection while a channel is still open