Use rand() on Windows

MSVS 2010 reports random() as identifier not found.