MEDIUM: backend: implement "http-reuse safe"

The "safe" mode consists in picking existing connections only when
processing a request that's not the first one from a connection. This
ensures that in case where the server finally times out and closes, the
client can decide to replay idempotent requests.
diff --git a/src/backend.c b/src/backend.c
index 93eecbf..18f688d 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1046,8 +1046,9 @@
 			 */
 		}
 
-		if ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS &&
-		    !LIST_ISEMPTY(&srv->idle_conns)) {
+		if (((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS ||
+		     ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_SAFE && s->txn && (s->txn->flags & TX_NOT_FIRST)))
+		    && !LIST_ISEMPTY(&srv->idle_conns)) {
 			/* We're going to have to pick the first connection
 			 * from this pool and use it for our purposes. We may
 			 * have to get rid of the current idle connection, so