Properly pthread_join miner threads on shutdown.