VTY: safe version of printing VTY welcome message

The old method used raw writes to the telnet FD, which is bad for
several reasons:
  a) we don't know if we can actually write that many bytes to the
     socket at the given time
  b) the socket is still in blocking mode, so we could stall the entire
     process
  c) there may be weird interaction with the buffered writes of the
     vty_out

Now, the print_welcome() functionality has moved to vty_hello() instead,
where we can use normal vty_out() in buffered mode.

This commit is expected to fix the garbled welcome message on arm-eglibc
targets.

It might still be a good idea to migrate the entire telnet interface to
libtelnet - but at some later time ;)
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 04df2be..86131ec 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -339,6 +339,17 @@
 /* Say hello to vty interface. */
 void vty_hello(struct vty *vty)
 {
+	const char *app_name = "<unnamed>";
+
+	if (host.app_info->name)
+		app_name = host.app_info->name;
+
+	vty_out(vty, "Welcome to the %s control interface%s",
+		app_name, VTY_NEWLINE);
+
+	if (host.app_info->copyright)
+		vty_out(vty, host.app_info->copyright);
+
 	if (host.motdfile) {
 		FILE *f;
 		char buf[4096];