Set errno to ECONNRESET when server closes connection prematurely.