Fix EmuThread loop by ensuring it exits properly.