MINOR: task/stream: tasks related to a stream must be init by the caller.

The task_wakeup was called on stream_new, but the task/stream
wasn't fully initialized yet. The task_wakeup must be called
explicitly by the caller once the task/stream is initialized.
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 9288de9..e59922c 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -1960,6 +1960,8 @@
 	task_wakeup(SPOE_APPCTX(appctx)->task, TASK_WOKEN_INIT);
 	LIST_ADDQ(&conf->agent->applets, &SPOE_APPCTX(appctx)->list);
 	conf->agent->applets_act++;
+
+	task_wakeup(task, TASK_WOKEN_INIT);
 	return appctx;
 
 	/* Error unrolling */
diff --git a/src/hlua.c b/src/hlua.c
index b8d2c88..85e0c66 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2353,6 +2353,7 @@
 	jobs++;
 	totalconn++;
 
+	task_wakeup(task, TASK_WOKEN_INIT);
 	/* Return yield waiting for connection. */
 	return 1;
 
diff --git a/src/peers.c b/src/peers.c
index 7f63aa9..643b8c5 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -1835,6 +1835,7 @@
 	totalconn++;
 
 	peer->appctx = appctx;
+	task_wakeup(t, TASK_WOKEN_INIT);
 	return appctx;
 
 	/* Error unrolling */
diff --git a/src/session.c b/src/session.c
index 34250eb..46b9f67 100644
--- a/src/session.c
+++ b/src/session.c
@@ -276,6 +276,7 @@
 	strm->target         = sess->listener->default_target;
 	strm->req.analysers |= sess->listener->analysers;
 
+	task_wakeup(t, TASK_WOKEN_INIT);
 	return 1;
 
  out_free_task:
@@ -446,6 +447,7 @@
 	strm->req.analysers |= sess->listener->analysers;
 	conn->flags &= ~CO_FL_INIT_DATA;
 
+	task_wakeup(task, TASK_WOKEN_INIT);
 	return 0;
 
  fail:
diff --git a/src/stream.c b/src/stream.c
index bc8b3af..7874837 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -239,9 +239,10 @@
 
 	/* it is important not to call the wakeup function directly but to
 	 * pass through task_wakeup(), because this one knows how to apply
-	 * priorities to tasks.
+	 * priorities to tasks. Using multi thread we must be sure that
+	 * stream is fully initialized before calling task_wakeup. So
+	 * the caller must handle the task_wakeup
 	 */
-	task_wakeup(t, TASK_WOKEN_INIT);
 	return s;
 
 	/* Error unrolling */