Add OS agnostic RAND_MAX