library: Ensure setverdict(fail) is followed by mtc.stop

This will prevent subsequent failures from overwriting the verdict so we
can easily see the root cause of the test failure.

Using testcase.stop instead for errors internal to our test
infrastructure to mark them as test errors instead of failed.

Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778
diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn
index 70885c9..da3b80d 100644
--- a/library/Osmocom_CTRL_Functions.ttcn
+++ b/library/Osmocom_CTRL_Functions.ttcn
@@ -40,10 +40,12 @@
 		[] pt.receive(tr_CtrlMsgTrap) { repeat; }
 		[] pt.receive(tr_CtrlMsgError) -> value rx {
 			setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason);
+			mtc.stop;
 			return "FAIL";
 			}
 		[] T.timeout {
 			setverdict(fail, "Timeout waiting for CTRL GET REPLY ", variable);
+			mtc.stop;
 			return "TIMEOUT";
 			}
 		}
@@ -62,9 +64,11 @@
 		[] pt.receive(tr_CtrlMsgTrap) { repeat; }
 		[] pt.receive(tr_CtrlMsgError) -> value rx {
 			setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason);
+			mtc.stop;
 			}
 		[] T.timeout {
 			setverdict(fail, "Timeout waiting for CTRL SET REPLY ", variable);
+			mtc.stop;
 			}
 		}
 	}
@@ -80,6 +84,7 @@
 			}
 		[] T.timeout {
 			setverdict(fail, "Timeout waiting for TRAP ", variable);
+			mtc.stop;
 			return "TIMEOUT";
 			}
 		}
@@ -92,6 +97,7 @@
 		ctrl_resp := f_ctrl_get(pt, variable);
 		if (not match(ctrl_resp, exp)) {
 			setverdict(fail, "Unexpected " & variable & ":" & ctrl_resp);
+			mtc.stop;
 		}
 	}
 
@@ -111,6 +117,7 @@
 		ctrl_resp := f_ctrl_get(pt, variable);
 		if (not match(str2int(ctrl_resp), exp)) {
 			setverdict(fail, variable & " value " & ctrl_resp & " didn't match ", exp);
+			mtc.stop;
 		}
 	}