Guard the RAND_MAX definition with #ifndef conditional directives

Contributed by Wilson Mar