is already locked at this point
of course it needs to be a write lock! fixes segfault
since mining_threads count can change, we need to lock more carefully and get_thread function is not helpful anymore
just in case, read-lock devices