Use rand() twice on platforms where RAND_MAX < 2^16.