BUG/MEDIUM: lua: the function txn_done() from sample fetches can crash

The function txn_done() ends a transaction. It does not make
sense to call this function from a lua sample-fetch wrapper,
because the role of a sample-fetch is not to terminate a
transaction.

This patch modify the role of the fucntion txn_done() if it
is called from a sample-fetch wrapper, now it just ends the
execution of the Lua code like the done() function.

Must be backported in 1.6
diff --git a/include/types/hlua.h b/include/types/hlua.h
index 43e9f1a..b22e03e 100644
--- a/include/types/hlua.h
+++ b/include/types/hlua.h
@@ -35,6 +35,8 @@
 #define HLUA_F_AS_STRING    0x01
 #define HLUA_F_MAY_USE_HTTP 0x02
 
+#define HLUA_TXN_NOTERM 0x00000001
+
 #define HLUA_CONCAT_BLOCSZ 2048
 
 enum hlua_exec {
@@ -109,6 +111,7 @@
 	struct stream *s;
 	struct proxy *p;
 	int dir;                /* SMP_OPT_DIR_{REQ,RES} */
+	int flags;
 };
 
 /* This struct contains the applet context. */