Merge pull request #515 from Armada651/threading Make the emulation stop asynchronous to prevent deadlocks.