correctly check RAND_bytes error code
Merge pull request #878 from ggkitsas/rand-bytes-error-check

correctly check RAND_bytes error code