FIX: keyboard navigation in the search box results dropdown

Currently (can be verified on meta.discourse.org/) it is possible to navigate (by pressing down arrow) past the last result displayed in the search dropdown. This PR fixes the bug, so the navigation stops at the last row.