data
engine: Fixing bug with Playing flag
engine: Added safety cleanup function
curses: Fixed message handler

If the engine sent messages when the curses interface is closed, exceptions were thrown. Now the messages are routed to the stdout instead.