Use a wrapper program to ensure termination when the emulator exits