Fix thread stuck on stopping emulation

Thread got stuck waiting if there is a thread switch after the eventsignal