Support temporary locations other than /tmp

Depending on the value of ${TMPDIR}, mktemp may create files and
folders outside of /tmp. Simply using the basename of mktemp's result
allows the nonce to be determined regardless of the location of the
temporary folder.