Fix crash if _thread is not initialized before.