library/RTP_Emulation: Close previous socket after rebind

If test calls RTPEM_bind twice, the previous socket is kept open
(ConnId 1) while the new one is assigned to the the expected ConnId for
RTP/RTCP packets received (ConnId), however, if remote was already
sending packets, it may happen that the port still receives those with
ConnId=1, which may make test fail with message:
"Received unexpected type from RTP"

Change-Id: I73f4af4e590dd3958e3f4d1dba0496c0750d642d
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index 70604dc..900a196 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -4,7 +4,7 @@
  *  * act as a RTP source that generates a RTP Stream
  *  * act asaa RTP sink that consumes a RTP Stream
  *
- * for all of the above, we want to be able to 
+ * for all of the above, we want to be able to
  *  * specify the payload type
  *  * specify the interval / sample rate
  *  * create drop-outs in the stream
@@ -387,6 +387,11 @@
 			}
 
 			g_tx_connected := false; /* will set it back to true upon next connect() call */
+
+			if (g_rtp_conn_id != -1) {
+				res := RTP_CodecPort_CtrlFunct.f_IPL4_close(RTP, g_rtp_conn_id, {udp := {}});
+				g_rtp_conn_id := -1;
+			}
 			res := RTP_CodecPort_CtrlFunct.f_IPL4_listen(RTP, g_local_host,
 								g_local_port, {udp:={}});
 			if (not ispresent(res.connId)) {
@@ -395,6 +400,11 @@
 			}
 			g_rtp_conn_id := res.connId;
 			tr_rtp.connId := g_rtp_conn_id;
+
+			if (g_rtcp_conn_id != -1) {
+				res := RTP_CodecPort_CtrlFunct.f_IPL4_close(RTCP, g_rtcp_conn_id, {udp := {}});
+				g_rtcp_conn_id := -1;
+			}
 			res := RTP_CodecPort_CtrlFunct.f_IPL4_listen(RTCP, g_local_host,
 								g_local_port+1, {udp:={}});
 			if (not ispresent(res.connId)) {