MEDIUM: threads: automatically assign threads to groups

This takes care of unassigned threads groups and places unassigned
threads there, in a more or less balanced way. Too sparse allocations
may still fail though. For now with a maximum group number fixed to 1
nothing can really fail.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index fe49811..f8e777e 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2439,6 +2439,11 @@
 	if (!global.nbtgroups)
 		global.nbtgroups = 1;
 
+	if (thread_map_to_groups() < 0) {
+		err_code |= ERR_ALERT | ERR_FATAL;
+		goto out;
+	}
+
 	pool_head_requri = create_pool("requri", global.tune.requri_len , MEM_F_SHARED);
 
 	pool_head_capture = create_pool("capture", global.tune.cookie_len, MEM_F_SHARED);