Fix the generation of unique filenames

We can't keep creating 'Random' objects in a tight loop as they will
have the same seed and therefore the sequence will always be the same.
The correct approach is to create a single System.Random and keep
calling .Next () on that to get at unique sequence of numbers.