Fix wrong thread id when resuming after interrupt.

Who knows what kind of havoc this was causing.