patch 9.0.0447: using :echowin while at the hit-enter prompt causes problems

Problem:    Using :echowin while at the hit-enter prompt causes problems.
Solution:   Do not prompt for :echowin.  Postpone showing the message window.
            Start the timer when the window is displayed.
diff --git a/src/testdir/dumps/Test_echowindow_6.dump b/src/testdir/dumps/Test_echowindow_6.dump
new file mode 100644
index 0000000..3bf6303
--- /dev/null
+++ b/src/testdir/dumps/Test_echowindow_6.dump
@@ -0,0 +1,8 @@
+|~+0#4040ff13#ffffff0| @73
+|~| @73
+|~| @73
+|~| @73
+|o+0#0000000&|n|e| @71
+|t|w|o| @71
+|t|h|r|e@1| @69
+|P+0#00e0003&|r|e|s@1| |E|N|T|E|R| |o|r| |t|y|p|e| |c|o|m@1|a|n|d| |t|o| |c|o|n|t|i|n|u|e> +0#0000000&@35
diff --git a/src/testdir/dumps/Test_echowindow_7.dump b/src/testdir/dumps/Test_echowindow_7.dump
new file mode 100644
index 0000000..774495f
--- /dev/null
+++ b/src/testdir/dumps/Test_echowindow_7.dump
@@ -0,0 +1,8 @@
+>s+0&#ffffff0|o|m|e| |t|e|x|t| @65
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|═+0#e000002&@74
+|l|a|t|e|r| |m|e|s@1|a|g|e| @61
+| +0#0000000&@74
+@57|1|,|1| @10|A|l@1| 
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index 4a2deae..6dc9a5b 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -401,6 +401,28 @@
           echowindow 'line' n
         endfor
       endfunc
+
+      def TwoMessages()
+        popup_clear()
+        set cmdheight=2
+        redraw
+        timer_start(100, (_) => {
+            echowin 'message'
+          })
+        echo 'one'
+        echo 'two'
+      enddef
+
+      def ThreeMessages()
+        popup_clear()
+        redraw
+        timer_start(100, (_) => {
+            echowin 'later message'
+          })
+        echo 'one'
+        echo 'two'
+        echo 'three'
+      enddef
   END
   call writefile(lines, 'XtestEchowindow')
   let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
@@ -415,6 +437,16 @@
   call term_sendkeys(buf, ":call ManyMessages()\<CR>")
   call VerifyScreenDump(buf, 'Test_echowindow_4', {})
 
+  call term_sendkeys(buf, ":call TwoMessages()\<CR>")
+  call VerifyScreenDump(buf, 'Test_echowindow_5', {})
+
+  call term_sendkeys(buf, ":call ThreeMessages()\<CR>")
+  sleep 120m
+  call VerifyScreenDump(buf, 'Test_echowindow_6', {})
+
+  call term_sendkeys(buf, "\<CR>")
+  call VerifyScreenDump(buf, 'Test_echowindow_7', {})
+
   " clean up
   call StopVimInTerminal(buf)
   call delete('XtestEchowindow')