GSUP: change osmo_gsup_encode() return type

* match return type of osmo_gsup_encode() with osmo_gsup_decode() to allow
  propagating error to caller
* check return value of osmo_gsup_encode() in GSUP test
* return errors instead of braking app with aseert

Change-Id: Idaa1deecb6d9e15329bd51867b4f6a03357461f0
Related: OS#2864
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index eddcc92..b55f1d9 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -220,7 +220,9 @@
 		if (rc < 0)
 			passed = false;
 
-		osmo_gsup_encode(msg, &gm);
+		rc = osmo_gsup_encode(msg, &gm);
+		if (rc < 0)
+			passed = false;
 
 		fprintf(stderr, "  generated message: %s\n", msgb_hexdump(msg));
 		fprintf(stderr, "  original message:  %s\n", osmo_hexdump(t->data, t->data_len));