Fixed crash during uninstall due to thread class being deleted before th...

...read has stopped