BUG/MEDIUM: protocols: add a global lock for the init/deinit stuff

Dragan Dosen found that the listeners lock is not sufficient to protect
the listeners list when proxies are stopping because the listeners are
also unlinked from the protocol list, and under certain situations like
bombing with soft-stop signals or shutting down many frontends in parallel
from multiple CLI connections, it could be possible to provoke multiple
instances of delete_listener() to be called in parallel for different
listeners, thus corrupting the protocol lists.

Such operations are pretty rare, they are performed once per proxy upon
startup and once per proxy on shut down. Thus there is no point trying
to optimize anything and we can use a global lock to protect the protocol
lists during these manipulations.

This fix (or a variant) will have to be backported as far as 1.8.
diff --git a/include/types/protocol.h b/include/types/protocol.h
index 1d3404b..f38baeb 100644
--- a/include/types/protocol.h
+++ b/include/types/protocol.h
@@ -80,9 +80,9 @@
 	int (*pause)(struct listener *l);               /* temporarily pause this listener for a soft restart */
 	void (*add)(struct listener *l, int port);      /* add a listener for this protocol and port */
 
-	struct list listeners;				/* list of listeners using this protocol */
-	int nb_listeners;				/* number of listeners */
-	struct list list;				/* list of registered protocols */
+	struct list listeners;				/* list of listeners using this protocol (under proto_lock) */
+	int nb_listeners;				/* number of listeners (under proto_lock) */
+	struct list list;				/* list of registered protocols (under proto_lock) */
 };
 
 #define CONNECT_HAS_DATA                        0x00000001 /* There's data available to be sent */