make tmpdir configurable

We needed to have the tmpdir configurable for some clients, so forked and added.