MINOR: log: stop emitting alerts when it's not possible to write on the socket

This is a recurring pain when using certain unix domain sockets or when
sending to temporarily unroutable addresses, if the process remains in
the foreground, the console is full of error which it's impossible to
do anything about. It's even worse when the process is remote, or when
run from a serial console which will slow the whole process down. Let's
send them only once now to warn about a possible config issue, and not
pollute the system nor slow everything down.
diff --git a/src/log.c b/src/log.c
index de775af..e2dde84 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1168,8 +1168,13 @@
 			int proto = logsrv->addr.ss_family == AF_UNIX ? 0 : IPPROTO_UDP;
 
 			if ((*plogfd = socket(logsrv->addr.ss_family, SOCK_DGRAM, proto)) < 0) {
-				ha_alert("socket for logger #%d failed: %s (errno=%d)\n",
-					 nblogger, strerror(errno), errno);
+				static char once;
+
+				if (!once) {
+					once = 1; /* note: no need for atomic ops here */
+					ha_alert("socket for logger #%d failed: %s (errno=%d)\n",
+					         nblogger, strerror(errno), errno);
+				}
 				continue;
 			}
 			/* we don't want to receive anything on this socket */
@@ -1297,8 +1302,13 @@
 		sent = sendmsg(*plogfd, &msghdr, MSG_DONTWAIT | MSG_NOSIGNAL);
 
 		if (sent < 0) {
-			ha_alert("sendmsg logger #%d failed: %s (errno=%d)\n",
-				 nblogger, strerror(errno), errno);
+			static char once;
+
+			if (!once) {
+				once = 1; /* note: no need for atomic ops here */
+				ha_alert("sendmsg logger #%d failed: %s (errno=%d)\n",
+				         nblogger, strerror(errno), errno);
+			}
 		}
 	}
 }