vty: do not change number_endpoints at runtime

The variable number_endpoints is used as a length indicator
for the array that contains the trunk endpoints at all times.
When osmo-mgw is startet up, the variable is set and osmo-mgw
will allocate the memory for the endpoints. However, it is
still possible to manipulate the variable via the telnet
interface. When the value is increased osmo-mgw might start
using unallocated memory at some point.

Store subsequent changes of number_enspoints in a separate
variable in order to write them to the config file. The
changes will then take effect after a restart.

Closes: OS#2632
Change-Id: I3994af016fb96427263edbba05f560743f85fdd4
diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 42a91d8..c7634fb 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -151,6 +151,7 @@
 	int rtp_accept_all;
 
 	unsigned int number_endpoints;
+	int vty_number_endpoints;
 	struct mgcp_endpoint *endpoints;
 };