patch 9.0.1597: cursor ends up below the window after a put

Problem:    Cursor ends up below the window after a put.
Solution:   Mark w_crow and w_botline invalid when changing the cursor line.
            (closes #12465)
diff --git a/src/eval.c b/src/eval.c
index b8d954d..89141bf 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -6322,6 +6322,10 @@
 
     if (name[0] == 'w' && dollar_lnum)
     {
+	// the "w_valid" flags are not reset when moving the cursor, but they
+	// do matter for update_topline() and validate_botline().
+	check_cursor_moved(curwin);
+
 	pos.col = 0;
 	if (name[1] == '0')		// "w0": first visible line
 	{