win32: replace random() by our own function