patch 8.2.2686: status line is not updated when going to cmdline mode

Problem:    Status line is not updated when going to cmdline mode.
Solution:   Redraw status lines if 'statusline' is set and going to status
            line mode. (based on patch from Justin M. Keyes et al.,
            closes #8044)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 2be8156..58cd6c3 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1706,6 +1706,15 @@
     // and execute commands. Display may be messed up a bit.
     if (did_emsg)
 	redrawcmd();
+
+    // Redraw the statusline in case it uses the current mode using the mode()
+    // function.
+    if (!cmd_silent && msg_scrolled == 0 && *p_stl != NUL)
+    {
+	curwin->w_redr_status = TRUE;
+	redraw_statuslines();
+    }
+
     did_emsg = FALSE;
     got_int = FALSE;