Threads will now only handle signals once they are not holding any mutexes. This removes some dead locks.