If not previous TMPDIR was set, delete the environment variable

- Patch submitted by sean fagan

Ticket: #4390