Add workaround for libpam-tmpdir.
Set TMP and TMPDIR before working in chroot, to avoid trying
to use a nonexisting directory as temporary storage.  Based on
a patch from James Valleroy.