Use rand instead of rand_r as rand_r is not necessary and rand is available on Win32.