Use input_context to handle input in inventory screen, hopefully fixing some odd SDL input bugs

Use input_context (in "legacy mode") to handle input in inventory screen.

This should hopefully workaround some weird SDL input bugs in the cross compiled Windows build that caused #4539.

This also allows the ncurses version to register for mouse events on startup and keep them registered, because using the mouse now won't return an invalid input in the inventory screen.