bsc: detect subscr and conn leaks during f_shutdown_helper()

Invoke f_verify_talloc_count() for bsc_subscr and
gsm_subscriber_connection, expecting none to remain after each test.

This makes numerous tests fail, where the test does not properly release
the RSL and BSSAP connections. An upcoming patch fixes all of those
cases: I9396efcabc085d2850244c6468b83c5f3a3ff3a2

Related: OS#5337
Change-Id: I69d4c5c6f8d499bb7f0b96a48af045361433c57b
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 891d340..d68cba2 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -857,6 +857,11 @@
 
 
 friend function f_shutdown_helper() runs on test_CT {
+	/* Run the subscr and conn leak test only when the VTY is initialized */
+	if (BSCVTY.checkstate("Mapped")) {
+		f_verify_talloc_count(BSCVTY, {"struct bsc_subscr", "struct gsm_subscriber_connection"});
+	}
+
 	all component.stop;
 	setverdict(pass);
 	mtc.stop;