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/include/proto/connection.h b/include/proto/connection.h
index 115e7aa..88c7e50 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -1091,6 +1091,9 @@
 	return conn_install_mux(conn, mux_ops, ctx, prx, sess);
 }
 
+/* Change the mux for the connection.
+ * The caller should make sure he's not subscribed to the underlying XPRT.
+ */
 static inline int conn_upgrade_mux_fe(struct connection *conn, void *ctx, struct buffer *buf,
 				      struct ist mux_proto, int mode)
 {
@@ -1118,7 +1121,6 @@
 	old_mux_ctx = conn->ctx;
 	conn->mux = new_mux;
 	conn->ctx = ctx;
-	conn_force_unsubscribe(conn);
 	if (new_mux->init(conn, bind_conf->frontend, conn->owner, buf) == -1) {
 		/* The mux upgrade failed, so restore the old mux */
 		conn->ctx = old_mux_ctx;