Closing socket if it EOFs

This corrects a bug I've been running into: supervisor sometimes seems to close the socket after a request is completed, which causes the following request made by SupervisorClient to fail mysteriously with an error about a missing content-length header.