BUG/MEDIUM: connections: Make sure we're unsubscribe before upgrading the mux.

Just calling conn_force_unsubscribe() from conn_upgrade_mux_fe() is not
enough, as there may be multiple XPRT involved. Instead, require that
any user of conn_upgrade_mux_fe() unsubscribe itself before calling it.
This should fix upgrading a TCP connection to HTX when using SSL.

This should be backported to 2.0.

(cherry picked from commit 2ab3dada015e071f505554cf443bfc438ce863e5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 37cc825..e0880e5 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -465,6 +465,10 @@
 
 		if (conn && h1c->flags & H1C_F_UPG_H2C) {
 			h1c->flags &= ~H1C_F_UPG_H2C;
+			/* Make sure we're no longer subscribed to anything */
+			if (h1c->wait_event.events)
+				conn->xprt->unsubscribe(conn, conn->xprt_ctx,
+				    h1c->wait_event.events, &h1c->wait_event);
 			if (conn_upgrade_mux_fe(conn, NULL, &h1c->ibuf, ist("h2"), PROTO_MODE_HTX) != -1) {
 				/* connection successfully upgraded to H2, this
 				 * mux was already released */