hwrng: move some code out mutex_lock for avoiding underlying deadlock