Unfortunately, I don't think there's a good way to implement net.Conn
semantics on top of channels. The Close and SendMessage methods should
gracefully fail without panicking if the connection is already closed.
Using only channels leads to race conditions.
We could remove the lock if Close and SendMessage are only called from a
single goroutine. However that's not the case right now.
Closes: https://todo.sr.ht/~emersion/soju/55