libmsc: fix memory leak (struct msgb) in msc_i_ran_enc()

Function msc_i_ran_enc() calls msc_role_ran_encode(), but unlike the
other callers of this function it does not free() the encoded message.

A simple solution would be to call msgb_free(), like it's done in
the other places.  But a more elegant solution is to modify function
msc_role_ran_encode(), so that it attaches the msgb to OTC_SELECT.
This way there is no need to call msgb_free() here and there.

This change fixes a memleak observed while running ttcn3-msc-test.

Change-Id: I741e082badc32ba9a97c1495c894e1d22e122e3a
Related: OS#5340
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 74721d2..c9b0572 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1659,12 +1659,9 @@
 		.an_proto = msc_a->c.ran->an_proto,
 		.msg = msc_role_ran_encode(msc_a->c.fi, ran_msg),
 	};
-	int rc;
 	if (!an_apdu.msg)
 		return -EIO;
-	rc = _msub_role_dispatch(msc_a->c.msub, to_role, to_role_event, &an_apdu, file, line);
-	msgb_free(an_apdu.msg);
-	return rc;
+	return _msub_role_dispatch(msc_a->c.msub, to_role, to_role_event, &an_apdu, file, line);
 }
 
 int msc_a_tx_dtap_to_i(struct msc_a *msc_a, struct msgb *dtap)