Move stdio/event input to its own thread and create a unified message queue for events from that thread and the CEC thread.