Ensure the value returned from ast_random is between 0 and RAND_MAX on 64-bit platforms.