Handle connection close of POST/PUT request correctly so that server can...

... close a connection after sending the response without reading the whole request body.