vty: allow flushing

It was so far sufficient to wait for the buffers to drain at some
random point in time, but this is not always the case, sometimes it is
important that the output is flushed immediately.

Change-Id: If984b9ad2eba9f400bc29a7aa8825e241fd1d2a9
diff --git a/src/vty/vty.c b/src/vty/vty.c
index a39f268..1ad84f5 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -207,6 +207,12 @@
 	}
 }
 
+void vty_flush(struct vty *vty)
+{
+	if (vty->obuf)
+		buffer_flush_all(vty->obuf, vty->fd);
+}
+
 /*! Close a given vty interface. */
 void vty_close(struct vty *vty)
 {