Use a proper mechanism for obtaining a tmpdir.
Merge pull request #6 from benjyw/proper_tmpdir

Use a proper mechanism for obtaining a tmpdir.