Do not do thread shutdown unless thread init succeeded
diff --git a/cgminer.c b/cgminer.c
index 91d0a2f..9afee32 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -7707,9 +7707,8 @@ void *miner_thread(void *userdata)
cgpu->last_device_valid_work = time(NULL);
drv->hash_work(mythr);
-out:
drv->thread_shutdown(mythr);
-
+out:
return NULL;
}