patch 8.0.0778: in a terminal the cursor may be hidden

Problem:    In a terminal the cursor may be hidden and screen updating lags
            behind. (Nazri Ramliy)
Solution:   Switch the cursor on and flush output when needed. (Ozaki Kiichi)
diff --git a/src/terminal.c b/src/terminal.c
index 4cc755c..e4e9cec 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -321,13 +321,14 @@
     static void
 update_cursor(term_T *term, int redraw)
 {
-    /* TODO: this should not always be needed */
     setcursor();
-    if (redraw && term->tl_buffer == curbuf && term->tl_cursor_visible)
+    if (redraw && term->tl_buffer == curbuf)
     {
+	if (term->tl_cursor_visible)
+	    cursor_on();
 	out_flush();
 #ifdef FEAT_GUI
-	if (gui.in_use)
+	if (gui.in_use && term->tl_cursor_visible)
 	    gui_update_cursor(FALSE, FALSE);
 #endif
     }
diff --git a/src/version.c b/src/version.c
index fe82a36..051f75f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    778,
+/**/
     777,
 /**/
     776,