patch 7.4.2328
Problem:    Crash when BufWinLeave autocmd goes to another tab page. (Hirohito
            Higashi)
Solution:   Make close_buffer() go back to the right window.
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 43aa8d4..c029ca1 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -83,6 +83,16 @@
   quit
 endfunc
 
+function Test_autocmd_bufwinleave_with_tabfirst()
+  tabedit
+  augroup sample
+    autocmd!
+    autocmd BufWinLeave <buffer> tabfirst
+  augroup END
+  call setline(1, ['a', 'b', 'c'])
+  edit! a.txt
+endfunc
+
 " SEGV occurs in older versions.  (At least 7.4.2321 or older)
 function Test_autocmd_bufunload_avoiding_SEGV_01()
   split aa.txt