patch 8.0.1002: unnecessarily updating screen after timer callback

Problem:    Unnecessarily updating screen after timer callback.
Solution:   Check if calling the timer sets must_redraw.
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 3682e79..18930a6 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1194,6 +1194,7 @@
     long	next_due = -1;
     proftime_T	now;
     int		did_one = FALSE;
+    int		need_update_screen = FALSE;
     long	current_id = last_timer_id;
 # ifdef WIN3264
     LARGE_INTEGER   fr;
@@ -1221,10 +1222,12 @@
 	    int did_emsg_save = did_emsg;
 	    int called_emsg_save = called_emsg;
 	    int did_throw_save = did_throw;
+	    int	save_must_redraw = must_redraw;
 
 	    timer_busy = timer_busy > 0 || vgetc_busy > 0;
 	    vgetc_busy = 0;
 	    called_emsg = FALSE;
+	    must_redraw = 0;
 	    timer->tr_firing = TRUE;
 	    timer_callback(timer);
 	    timer->tr_firing = FALSE;
@@ -1240,6 +1243,10 @@
 	    }
 	    did_emsg = did_emsg_save;
 	    called_emsg = called_emsg_save;
+	    if (must_redraw != 0)
+		need_update_screen = TRUE;
+	    must_redraw = must_redraw > save_must_redraw
+					      ? must_redraw : save_must_redraw;
 
 	    /* Only fire the timer again if it repeats and stop_timer() wasn't
 	     * called while inside the callback (tr_id == -1). */
@@ -1265,7 +1272,7 @@
     }
 
     if (did_one)
-	redraw_after_callback();
+	redraw_after_callback(need_update_screen);
 
     return current_id != last_timer_id ? 1 : next_due;
 }