vty: Attempt to fix various meam leaks in the VTY lookup code

These routines were not freeing vectors used for the lookup. On
review it is fixing another path not detected by coverity.

The danger is a double free in tab completion now. It is difficult
to test this.

Fixes: Coverity CID 23037, CID 23038
diff --git a/src/vty/command.c b/src/vty/command.c
index 4f47a6b..faa7c51 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -1574,10 +1574,12 @@
 		if ((ret = is_cmd_ambiguous(command, cmd_vector, i,
 					    match)) == 1) {
 			vector_free(cmd_vector);
+			vector_free(matchvec);
 			*status = CMD_ERR_AMBIGUOUS;
 			return NULL;
 		} else if (ret == 2) {
 			vector_free(cmd_vector);
+			vector_free(matchvec);
 			*status = CMD_ERR_NO_MATCH;
 			return NULL;
 		}
@@ -1724,6 +1726,7 @@
 
 	if (vector_active(vline) == 0) {
 		*status = CMD_ERR_NO_MATCH;
+		vector_free(cmd_vector);
 		return NULL;
 	} else
 		index = vector_active(vline) - 1;