Put a mutex around thread_exited_list, sometimes threads finish while processing quitting threads which does weird stuff