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/version.c b/src/version.c
index 254aafd..12a5de8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2474,
+/**/
     2473,
 /**/
     2472,