Restore thread if there's no interrupt handler set.

If dispatch is disabled and we don't do this, it'll just hang, never
switching back to a thread that can re-enable dispatch.

Fixes #5172.
Merge pull request #5174 from unknownbrackets/intr-fix

Restore thread if there's no interrupt handler set