patch 8.0.0483: illegal memory access when using :all

Problem:    Illegal memory access when using :all. (Dominique Pelle)
Solution:   Adjust the cursor position right after setting "curwin".
diff --git a/src/window.c b/src/window.c
index 06f97de..d0dff69 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2450,6 +2450,10 @@
 #endif
 	curbuf = curwin->w_buffer;
 	close_curwin = TRUE;
+
+	/* The cursor position may be invalid if the buffer changed after last
+	 * using the window. */
+	check_cursor();
     }
     if (p_ea && (*p_ead == 'b' || *p_ead == dir))
 	win_equal(curwin, TRUE, dir);