thread.h: do not wait in destructor if wait() has already been called
thread.h: do not wait in destructor if wait() has already been called

MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3