patch 8.0.1786: no test for 'termwinkey'

Problem:    No test for 'termwinkey'.
Solution:   Add a test.  Make feedkeys() handle terminal_loop() returning
            before characters are consumed.
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 0f72346..cde41a1 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -1471,3 +1471,19 @@
 
   set termwinsize=
 endfunc
+
+func Test_terminal_termwinkey()
+  call assert_equal(1, winnr('$'))
+  let thiswin = win_getid()
+
+  let buf = Run_shell_in_terminal({})
+  let termwin = bufwinid(buf)
+  set termwinkey=<C-L>
+  call feedkeys("\<C-L>w", 'tx')
+  call assert_equal(thiswin, win_getid())
+  call feedkeys("\<C-W>w", 'tx')
+
+  let job = term_getjob(buf)
+  call feedkeys("\<C-L>\<C-C>", 'tx')
+  call WaitForAssert({-> assert_equal("dead", job_status(job))})
+endfunc