Handle dead connections gracefully.
There is a pretty easy to hit flaw right now that prevents transfers from succeeding.
- Send a file.
- Close a browser.
- Send another file.
The second one attempts to reuse the connection and hangs forever. The connection is eventually reported as closed but we don't check for that. Ideally we would notice that and restart the transfer from the beginning.