Use java.io.tmpdir instead of /tmp

Fixes gh-441