BUG/MINOR: lua: fix extra 500ms added to socket timeouts

Since commit #56cc12509, haproxy accepts double values for timeouts. The
value is then converted to  milliseconds before being rounded up and cast
to int. The issue is that to round up the value, a constant value of 0.5
is added to it, but too early in the conversion, resulting in an
additional 500ms to the value. We are talking about a precision of 1ms,
so we can safely get rid of this rounding trick and adjust resulting
timeouts equal to 0 to a minimum of 1ms.

This patch is specific to the 1.9 branch and doesn't require to be
backported.
diff --git a/src/hlua.c b/src/hlua.c
index 06c1155..6598647 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2545,17 +2545,19 @@
 
 	socket = MAY_LJMP(hlua_checksocket(L, 1));
 
-	/* round up for inputs that are fractions and convert to millis */
-	dtmout = (0.5 + MAY_LJMP(luaL_checknumber(L, 2))) * 1000;
+	/* convert the timeout to millis */
+	dtmout = MAY_LJMP(luaL_checknumber(L, 2)) * 1000;
 
 	/* Check for negative values */
 	if (dtmout < 0)
 		WILL_LJMP(luaL_error(L, "settimeout: cannot set negatives values"));
 
 	if (dtmout > INT_MAX) /* overflow check */
-		WILL_LJMP(luaL_error(L, "settimeout: cannot set values larger than %d", INT_MAX));
+		WILL_LJMP(luaL_error(L, "settimeout: cannot set values larger than %d ms", INT_MAX));
 
 	tmout = MS_TO_TICKS((int)dtmout);
+	if (tmout == 0)
+		tmout++; /* very small timeouts are adjusted to a minium of 1ms */
 
 	/* Check if we run on the same thread than the xreator thread.
 	 * We cannot access to the socket if the thread is different.