Fix #3620

When switching pages, set iStartPos to 0.
Remove empty page detection in input loop, because it has already been detected before entering the loop.

This bug is caused only by this iStartPos: at "interface" page, there are 19 items, if MENU_SCROLL is set, when moving to the last item, iStartPos is set to "1" to scroll the window. But after switching to "debug" page, iStartPos is still "1", so the offset of items in this page to draw options is wrong, eventually it causes a stack overflow.

This fix should fix #3620