patch 8.0.1810: buffer of a terminal only updated in Terminal-Normal mode

Problem:    Buffer of a terminal only updated in Terminal-Normal mode.
Solution:   Copy the terminal window content to the buffer when in
            Terminal-Job mode.
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 7fa4907..d27d0cd 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1206,7 +1206,7 @@
 static timer_T	*first_timer = NULL;
 static long	last_timer_id = 0;
 
-    static long
+    long
 proftime_time_left(proftime_T *due, proftime_T *now)
 {
 #  ifdef WIN3264
@@ -1424,6 +1424,10 @@
 	    next_due = this_due;
     }
 #endif
+#ifdef FEAT_TERMINAL
+    /* Some terminal windows may need their buffer updated. */
+    next_due = term_check_timers(next_due, &now);
+#endif
 
     return current_id != last_timer_id ? 1 : next_due;
 }