Currently the thread would be stopped in the base destructor. Effectively leaving a race condition where the derived destructor is finished and the thread is still running, leading to segfaults.
Fix this by stopping the thread in the derived destructor.