Use mktemp to create a (semi)-random temporary dir, instead of the current "add number" hackery.
Use mktemp to create a (semi)-random temporary dir, instead of the current
not-random temporary dirname creation. mktemp only sets rwx permissions
for the user and not permission for the group or others.