[MEDIUM] add the SN_CURR_SESS flag to the session to track open sessions

It is quite hard to track when the current session has already been counted
or discounted from the server's total number of established sessions. For
this reason, we introduce a new session flag, SN_CURR_SESS, which indicates
if the current session is one of those reported by the server or not. It
simplifies session accounting and makes it far more robust. It also makes
it possible to perform a last-minute cleanup during session_free().

Right now, with this fix and a few more buffer transitions fixes, no session
were found to remain after a test.
diff --git a/src/backend.c b/src/backend.c
index de0537a..0d6fef1 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1820,6 +1820,7 @@
 
 	s->req->cons->state = SI_ST_CON;
 	if (s->srv) {
+		s->flags |= SN_CURR_SESS;
 		s->srv->cur_sess++;
 		if (s->srv->cur_sess > s->srv->cur_sess_max)
 			s->srv->cur_sess_max = s->srv->cur_sess;