VTY: decouple telnet_interface from 'struct gsmnet'

We want the VTY and telnet code to be independent from the BSC
application(s).  As a side note, we also like to eliminate static
global variables for 'struct gsm_network' all over the code.

As such, telnet_init() is now passed along a "private" pointer,
which getst stored in telnet_connection.priv.  This telnet_connection
is then stored in vty->priv, which in turn gets dereferenced if
anyone needs a reference to 'struct gsm_network' from the BSC vty
code.

Also:
 * vty_init() now calls cmd_init()
 * the ugliness that telnet_init() calls back into the application by means of
   bsc_vty_init() function has been removed.
 * telnet_init() now returns any errors, so the main program can exit
   e.g. if the port is already in use.
diff --git a/openbsc/src/vty_interface_cmds.c b/openbsc/src/vty_interface_cmds.c
index 06eb2a5..619caf5 100644
--- a/openbsc/src/vty_interface_cmds.c
+++ b/openbsc/src/vty_interface_cmds.c
@@ -19,17 +19,20 @@
  *
  */
 
-#include <openbsc/vty.h>
-#include <openbsc/telnet_interface.h>
+#include <stdlib.h>
+#include <string.h>
 
 #include <osmocore/talloc.h>
 
+#include <openbsc/vty.h>
+#include <openbsc/telnet_interface.h>
+#include <openbsc/gsm_data.h>
+#include <openbsc/debug.h>
+
 #include <vty/command.h>
 #include <vty/buffer.h>
 #include <vty/vty.h>
 
-#include <stdlib.h>
-
 static void _vty_output(struct log_target *tgt, const char *line)
 {
 	struct vty *vty = tgt->tgt_vty.vty;