Generate random filenames without mktemp().

Retaining the .gz file extension ensures that cfitsio
compresses the file when saving.