test: fix connection reset in http test
test: fix connection reset in http test

In this test, an HTTP server was ending the response before
consuming all the data sent in the PUT request.

Ending the response would cause the socket to be destroyed,
and since there is some data still to be read, an ECONNRESET is
surfaced on the client side, event though the client has already
ended its side and even seen a 'finish' event.

See:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.2

While it is certainly admissible for the server to send a response
before consuming the entire request, it seems reasonable to
expect that the server would close the connection afterwards
and that the ECONNRESET would be raised on the client.

So I have changed the test to wait until the entire request has been
consumed before sending the response.

dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node