[asan] Replace rand_r with rand in test.