BUG/MEDIUM: http: fix regression caused by recent switch to keep-alive by default

Yesterday's commit 70dffda ("MAJOR: http: switch to keep-alive mode by default")
broke HTTP/1.0 handling without keep-alive when keep-alive is enabled both in
the frontend and in the backend.

Before this patch, it used to work because tunnel mode was the default one,
so if no mode was present in the frontend and a mode was set in the backend,
the backend was the first one to parse the header. This is what the original
patch tried to do with keep-alive by default, causing the version and the
connection header to be ignored if both the frontend and the backend were
running in keep-alive mode.

The fix consists in always parsing the header in non-tunnel mode, and
processing the rest of the logic in at least once, and again if the
backend works in a different mode than the frontend.

This is 1.5-specific, no backport is needed.
diff --git a/src/proto_http.c b/src/proto_http.c
index bd07984..e92dc6a 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3549,8 +3549,7 @@
 	 * time.
 	 */
 
-	if ((!(txn->flags & TX_HDR_CONN_PRS) &&
-	     ((s->fe->options & PR_O_HTTP_MODE) != PR_O_HTTP_KAL)) ||
+	if (!(txn->flags & TX_HDR_CONN_PRS) ||
 	    ((s->fe->options & PR_O_HTTP_MODE) != (s->be->options & PR_O_HTTP_MODE))) {
 		int tmp = TX_CON_WANT_KAL;
 
@@ -3581,7 +3580,8 @@
 		if ((txn->flags & TX_CON_WANT_MSK) < tmp)
 			txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | tmp;
 
-		if (!(txn->flags & TX_HDR_CONN_PRS)) {
+		if (!(txn->flags & TX_HDR_CONN_PRS) &&
+		    (txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN) {
 			/* parse the Connection header and possibly clean it */
 			int to_del = 0;
 			if ((msg->flags & HTTP_MSGF_VER_11) ||