WriteToDisk and SafeWriteToDisk tests now pass

This is the first time that both the WriteToDisk and SafeWriteToDisk
tests pass
WriteToDisk and SafeWriteToDisk test cleaned up

Minor cleanup to randomise the names of the temp directories used by the
tests.