Wait the end of the thread in Thread::stop