BUG/MINOR: pattern: Rely on the sample type to copy it in pattern_exec_match

To be thread safe, the function pattern_exec_match copy data (the pattern and
the inner sample) in thread-local variables. But when the sample is duplicated,
we must check its type and not the pattern one.

This is specific to threads, no backport is needed.
diff --git a/src/pattern.c b/src/pattern.c
index 39ecd95..47e8aee 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -2592,7 +2592,7 @@
 			/* We also duplicate the sample data for
 			   same reason */
 			if (pat->data && (pat->data != &static_sample_data)) {
-				switch(pat->type) {
+				switch(pat->data->type) {
 					case SMP_T_STR:
 						static_sample_data.type = SMP_T_STR;
 						static_sample_data.u.str = *get_trash_chunk();