The first incarnation of window_scroll_up was cleaner, but I realized I had to prevent scrolling which leaves the number of visible rows less than win->nr_rows, else things like window_page_bottom will be confused.  Let me see if there's something better...

PS: The little while loop at the end was borrowed from window_page_bottom.