Added dead queue to save completed threds. This will require to implement POSIZ compatible thread_exit() and thread_join() functions