Fixed memory leak in secure_rand