threads: fix thread_interrupted exception

When quitting desurium we are running into this problem, because we want to join a thread, which gets interrupted.

NOTE: this is a candidate for the stable branch