valgrind introduce protocol init and destroy user callbacks

To get a clean bill of health from valgrind, we have to have a way to
inform the user code that we're going down and it should free everything
it is holding that was malloc'd.

This patch introduces LWS_CALLBACK_PROTOCOL_DESTROY which each protocol
gets when the context is being destroyed and no more activity will come
after that call.  They can get rid of everything there.

To match it, LWS_CALLBACK_PROTOCOL_INIT is introduced which would allow
one-time init per protocol too.

Signed-off-by: Andy Green <andy.green@linaro.org>
diff --git a/changelog b/changelog
index 442ab6a..cd789c3 100644
--- a/changelog
+++ b/changelog
@@ -21,6 +21,12 @@
 	can enable it by setting a non-zero timeout (in seconds) at the new
 	ka_time member at context creation time.
 
+ - Two new optional user callbacks added, LWS_CALLBACK_PROTOCOL_DESTROY which
+ 	is called one-time per protocol as the context is being destroyed, and
+	LWS_CALLBACK_PROTOCOL_INIT which is called when the context is created
+	and the protocols are added, again it's a one-time affair.
+	This lets you manage per-protocol allocations properly including
+	cleaning up after yourself when the server goes down.
 
 User api changes
 ----------------