_PATH_TMP instead of hardcoding /tmp if not set in the environment; fixes PR bin/7796 from Chris Demetriou.