tests: Use EOFError instead of socket.error to report unexpected connection closure.