Use mktemp in a more compatible way

Gnu mktemp does not support BSD's -t option