input: Add Lua key event dispatch

Add lua_cpcall wrapper, to keep the actual lua_State protected.

Might need to move a lot of Lua-related code/headers into a more
centralized internal header, since Lua is a core dependency