Use Dir.tmpdir instead of hardcoding /tmp.

This ensures that the downloading of resources work on systems where /tmp
doesn't exist.