wait for the cmdhandler thread to be gone before continuing