MAJOR: threads/peers: Make peers thread safe

A lock is used to protect accesses to a peer structure.

A the lock is taken in the applet handler when the peer is identified
and released living the applet handler.

In the scheduling task for peers section, the lock is taken for every
listed peer and released at the end of the process task function.

The peer 'force shutdown' function was also re-worked.
diff --git a/include/common/hathreads.h b/include/common/hathreads.h
index 8b32cf6..3a77bd1 100644
--- a/include/common/hathreads.h
+++ b/include/common/hathreads.h
@@ -155,6 +155,7 @@
 	STK_TABLE_LOCK,
 	STK_SESS_LOCK,
 	APPLETS_LOCK,
+	PEER_LOCK,
 	LOCK_LABELS
 };
 struct lock_stat {
@@ -241,7 +242,7 @@
 					   "TASK_RQ", "TASK_WQ", "POOL",
 					   "LISTENER", "LISTENER_QUEUE", "PROXY", "SERVER",
 					   "UPDATED_SERVERS", "LBPRM", "SIGNALS", "STK_TABLE", "STK_SESS",
-					   "APPLETS" };
+					   "APPLETS", "PEER" };
 	int lbl;
 
 	for (lbl = 0; lbl < LOCK_LABELS; lbl++) {