Test proxy behavior when origin server disconnects

Add a test for a CONNECT proxy where the remote server closes the connection, and then we try to reuse it.

This test demonstrates the problem described in #366 (and apparently reported earlier as #295)