Window close hack

When clicking X, sends ESC key message to stop the emulation.