bitcoin_miner: Made CPU miner thread safe by using per-thread randgen
bitcoin_miner: Made CPU miner thread safe by using per-thread randgen

Previously all threads called std::rand which is not guaranteed to be
thread-safe.  In my testing by CPU mining on testnet, I would sometimes
get multiple threads finding the *exact* same block solution! This is
because std::rand() when called across threads may return the exact same
value if re-entered before it finishes updating its internal (shared)
state.

Instead, we use a lambda that leverages the C++11 std::random_device and
other functions to keep a per-thread random number generator state.

The net result is now the threads won't do redundant proof-of-work and
each thread hopefully works on its own unique set of nonces.

BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited,Justaphf/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,Justaphf/BitcoinUnlimited