patch 8.0.1540: popup menu positioning fails with longer string

Problem:    Popup menu positioning fails with longer string.
Solution:   Only align with right side of window when width is less than
            'pumwidth' (closes #2661)
diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim
index 584f9ac..1016646 100644
--- a/src/testdir/screendump.vim
+++ b/src/testdir/screendump.vim
@@ -48,7 +48,7 @@
 " Stop a Vim running in terminal buffer "buf".
 func StopVimInTerminal(buf)
   call assert_equal("running", term_getstatus(a:buf))
-  call term_sendkeys(a:buf, ":qa!\<cr>")
+  call term_sendkeys(a:buf, "\<Esc>\<Esc>:qa!\<cr>")
   call WaitFor('term_getstatus(' . a:buf . ') == "finished"')
   only!
 endfunc