patch 8.2.2474: using freed memory when window is closed by autocommand

Problem:    Using freed memory when window is closed by autocommand.
            (houyunsong)
Solution:   Check the window pointer is still valid.
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 15d237e..e07731d 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
Binary files differ