Clean up event and interrupt interfaces.

 - Do event and interrupt signalling via functions. Removes ugly and
   error-prone 'pending_event' updates and update_irq_status() calls
   outside cpu.cpp.

 - Treat ending emulation as just another event for consistency (might
   also be a tiny bit faster).