Handle signals and exit for threads. Start a new thread if old thread is detached.