fix generation of random file names

used to choose one of the ranges at random and join all the characters
in the range together, leading to temp file names like __abcdefghijklmnopqrst
uvwxyz___ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz