socket: Return -ECONNRESET from socket_receive_timeout() instead of -EAGAIN if peer closed the socket

Returning -EAGAIN would indicate the caller can try again, but if the peer
closed the socket that wouldn't make any sense. Thanks to sctol for reporting.
diff --git a/common/socket.c b/common/socket.c
index 9ff138b..aa97848 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -49,6 +49,10 @@
 #define RECV_TIMEOUT 20000
 #define CONNECT_TIMEOUT 5000
 
+#ifndef ECONNRESET
+#define ECONNRESET 108
+#endif
+
 static int verbose = 0;
 
 void socket_set_verbose(int level)
@@ -475,7 +479,7 @@
 		// but this is an error condition
 		if (verbose >= 3)
 			fprintf(stderr, "%s: fd=%d recv returned 0\n", __func__, fd);
-		return -EAGAIN;
+		return -ECONNRESET;
 	}
 	if (result < 0) {
 		return -errno;