test: fix http-many-ended-pipelines server close

The test was calling server.close() without waiting for the server
to have received all the requests. This would cause an ECONNRESET.
test: fix http-incoming-pipelined-socket-destroy

The test was calling server.close() after write on the socket
had completed. However the fact that the write had completed was
not valid indication that the server had received the data.

This would result in a premutaure closing of the server and
an ECONNRESET event on the client.