random id generator (win32 incompatible)