lib: limit size of vty buffer to 4096 bytes

This removes the automatic resizing of the vty input buffer and places a
hard size cap of 4096 bytes. It also fixes a potentially unsafe strcpy.

[Edits by Paul Jakma, paul@jakma.org]
diff --git a/lib/command.c b/lib/command.c
index ab46fc4..242c98b 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2901,7 +2901,7 @@
   int ret;
   *line_num = 0;
 
-  while (fgets (vty->buf, VTY_BUFSIZ, fp))
+  while (fgets (vty->buf, vty->max, fp))
     {
       ++(*line_num);