mgcp_ratectr: do not set talloc destructor on library allocated item

The rate counter and stats item groups, which are allocated in
mgcp_ratectr.c are freed using a talloc destructor that is set in the
context of the item we just allocated using the stats / rate counter API
functions. When we do that, we risk overwriting an already existing
talloc destructor. Lets instead implement own free functions and set
those as talloc_destructor from above (trunk and MGCP config)

Change-Id: Ifc5091e9f95cc721e58d1eb2e55b97102c497706
Related: OS#5201
diff --git a/include/osmocom/mgcp/mgcp_ratectr.h b/include/osmocom/mgcp/mgcp_ratectr.h
index 5212f9b..48abc27 100644
--- a/include/osmocom/mgcp/mgcp_ratectr.h
+++ b/include/osmocom/mgcp/mgcp_ratectr.h
@@ -93,7 +93,9 @@
 struct mgcp_trunk;
 
 int mgcp_ratectr_global_alloc(struct mgcp_config *cfg);
+void mgcp_ratectr_global_free(struct mgcp_config *cfg);
 int mgcp_ratectr_trunk_alloc(struct mgcp_trunk *trunk);
+void mgcp_ratectr_trunk_free(struct mgcp_trunk *trunk);
 
 /* Trunk-global common stat items */
 enum {
@@ -107,4 +109,4 @@
 };
 
 int mgcp_stat_trunk_alloc(struct mgcp_trunk *trunk);
-
+void mgcp_stat_trunk_free(struct mgcp_trunk *trunk);