SDL2 fixes

This is the result of a review of #2433. The only actual bug I fixed was that pressing '/' in the sector view, which is supposed to just select the search box, would also (erroneously) put '/' into the search box. The other changes are just cleaning up some of the Lua console stuff to fit more nicely with the SDL2 text input system, and a couple of very minor code clean-up changes.