MEDIUM: listener: implement a per-protocol pause() function

In order to fix the abstact socket pause mechanism during soft restarts,
we'll need to proceed differently depending on the socket protocol. The
pause_listener() function already supports some protocol-specific handling
for the TCP case.

This commit makes this cleaner by adding a new ->pause() function to the
protocol struct, which, if defined, may be used to pause a listener of a
given protocol.

For now, only TCP has been adapted, with the specific code moved from
pause_listener() to tcp_pause_listener().
(cherry picked from commit 092d865c53de80afc847c5ff0a079b414041ce2a)
diff --git a/src/listener.c b/src/listener.c
index a82ce81..67f8ca7 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -95,15 +95,16 @@
 	if (l->state <= LI_PAUSED)
 		return 1;
 
-	if (l->proto->sock_prot == IPPROTO_TCP) {
-		if (shutdown(l->fd, SHUT_WR) != 0)
-			return 0; /* Solaris dies here */
-
-		if (listen(l->fd, l->backlog ? l->backlog : l->maxconn) != 0)
-			return 0; /* OpenBSD dies here */
+	if (l->proto->pause) {
+		/* Returns < 0 in case of failure, 0 if the listener
+		 * was totally stopped, or > 0 if correctly paused.
+		 */
+		int ret = l->proto->pause(l);
 
-		if (shutdown(l->fd, SHUT_RD) != 0)
-			return 0; /* should always be OK */
+		if (ret < 0)
+			return 0;
+		else if (ret == 0)
+			return 1;
 	}
 
 	if (l->state == LI_LIMITED)