Redo tickit.terminal event-handling to mirror Perl

This commit also fixes tickit.ctickit's attempted use of static inline
functions and updates the roguelike demo to use the new event handler
system in tickit.terminal.