bsc: make perform_clear() work when VTY is not initialized

To be able to invoke perform_clear() also in tests where the VTY isn't
used, in f_logp() only access the VTY when it is actually ready.
Otherwise this causes an error and a failed test, for no good reason.

Related: OS#5337
Change-Id: I8116075f32937bd06ba14b426010bf6fec2ef402
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 0dd4440..891d340 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1077,7 +1077,9 @@
 	// log on TTCN3 log output
 	log(log_msg);
 	// log in stderr log
-	f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
+	if (pt.checkstate("Mapped")) {
+		f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
+	}
 }
 
 private function f_sysinfo_seen(integer rsl_idx, RSL_Message rsl) runs on test_CT