implement GNU version of tempdir