patch 8.0.1414: accessing freed memory in :lfile.

Problem:    Accessing freed memory in :lfile.
Solution:   Get the current window after executing autocommands. (Yegappan
            Lakshmanan, closes #2473)
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index 8d0c198..a09ec73 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -3031,3 +3031,10 @@
   enew | only
 endfunc
 
+" The following test used to crash vim
+func Test_lfile_crash()
+  sp Xtest
+  au QuickFixCmdPre * bw
+  call assert_fails('lfile', 'E40')
+  au! QuickFixCmdPre
+endfunc