BUG/MINOR: ssl: use atomic ops to update global shctx stats

The global shctx lookups and misses was updated without using atomic
ops, so the stats available in "show info" are very likely off by a few
units over time. This should be backported as far as 1.8. Versions
without _HA_ATOMIC_INC() can use HA_ATOMIC_ADD(,1).

(cherry picked from commit 4c19e996218f6c205c1716a0b4718f9bced7f893)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 37d69399648e489fea9f93b7e9fae02dfa59acbb)
[wt: s/_HA_ATOMIC_INC/_HA_ATOMIC_ADD(,1)]
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 0123d48081c98ae693cb9015cf09bc9f999219df)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 6c7de18c588d18943554d79c187326a3ef283dde)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 65f070e..55f7964 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -4225,7 +4225,7 @@
 	SSL_SESSION *sess;
 	struct shared_block *first;
 
-	global.shctx_lookups++;
+	_HA_ATOMIC_ADD(&global.shctx_lookups, 1);
 
 	/* allow the session to be freed automatically by openssl */
 	*do_copy = 0;
@@ -4245,7 +4245,7 @@
 	if (!sh_ssl_sess) {
 		/* no session found: unlock cache and exit */
 		shctx_unlock(ssl_shctx);
-		global.shctx_misses++;
+		_HA_ATOMIC_ADD(&global.shctx_misses, 1);
 		return NULL;
 	}