BUG/MEDIUM: streams: Try to L7 retry before aborting the connection.

In htx_wait_for_response, in case of error, attempt a L7 retry before
aborting the connection if the TX_NOT_FIRST flag is set.
If we don't do that, then we wouldn't attempt L7 retries after the first
request, or if we use HTTP/2, as with HTTP/2 that flag is always set.
diff --git a/src/proto_htx.c b/src/proto_htx.c
index e7341c1..6393eed 100644
--- a/src/proto_htx.c
+++ b/src/proto_htx.c
@@ -1496,9 +1496,6 @@
 		if (rep->flags & CF_READ_ERROR) {
 			struct connection *conn = NULL;
 
-			if (txn->flags & TX_NOT_FIRST)
-				goto abort_keep_alive;
-
 			if (objt_cs(s->si[1].end))
 				conn = objt_cs(s->si[1].end)->conn;
 
@@ -1514,6 +1511,9 @@
 					return 0;
 			}
 
+			if (txn->flags & TX_NOT_FIRST)
+				goto abort_keep_alive;
+
 			_HA_ATOMIC_ADD(&s->be->be_counters.failed_resp, 1);
 			if (objt_server(s->target)) {
 				_HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_resp, 1);
@@ -1591,15 +1591,15 @@
 
 		/* 4: close from server, capture the response if the server has started to respond */
 		else if (rep->flags & CF_SHUTR) {
-			if (txn->flags & TX_NOT_FIRST)
-				goto abort_keep_alive;
-
 			if ((si_b->flags & SI_FL_L7_RETRY) &&
 			    (s->be->retry_type & PR_RE_DISCONNECTED)) {
 				if (co_data(rep) || do_l7_retry(s, si_b) == 0)
 					return 0;
 			}
 
+			if (txn->flags & TX_NOT_FIRST)
+				goto abort_keep_alive;
+
 			_HA_ATOMIC_ADD(&s->be->be_counters.failed_resp, 1);
 			if (objt_server(s->target)) {
 				_HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_resp, 1);