Check "send" failures in tor-proto, and handle them appropriately
There are a bunch of places in tor-proto that use send()
on one-shot or mpsc channels. These send
operations can fail if the other side has been closed.
Currently, some of these send operations (marked in the code) have their failures treated as internal errors. We should see whether they can actually happen in practice, and if so, treat them as a signal that the corresponding stream, circuit, or channel should be closed.
This isn't something we can do with a search-and-replace: we'll have to think carefully about how long the objects in question are supposed to live.