check when RAND_bytes returns 0

RAND_bytes returns 0 when there was not enough entropy.

On a modern desktop this should not be a problem with all of the sources of entropy we have.

If we are on an ARM device or an older computer and just logged into a console session this will cause RAND_bytes to return 0. Most of the randomness engine OpenSSL supports will also not modify the buffer that was given to the RAND_bytes function. This leads to us using chunks of memory as our 'secure_random' function.