BUG/MEDIUM: lua: Fix test on the direction to set the channel exp timeout

This bug was introduced by the commit bfab2ddd ("MINOR: hlua: Add a flag on the
lua txn to know in which context it can be used"). The wrong test was done. So
the timeout was always set on the response channel. It may lead to an infinite
loop.

This patch must be backported everywhere the commit bfab2ddd is. For now, at
least to 2.0, 1.9 and 1.8.

(cherry picked from commit 81921b13716e738dd49462cd79375f90a2bb35cb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/hlua.c b/src/hlua.c
index 465c2c2..d2708f8 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -6871,7 +6871,7 @@
 	case HLUA_E_AGAIN:
 		/* Set timeout in the required channel. */
 		if (s->hlua->wake_time != TICK_ETERNITY) {
-			if (dir & SMP_OPT_DIR_REQ)
+			if (dir == SMP_OPT_DIR_REQ)
 				s->req.analyse_exp = s->hlua->wake_time;
 			else
 				s->res.analyse_exp = s->hlua->wake_time;