On second thought, the mktemp solution was a kludge.
Better solution: Add a configurable variable replacement for the tempfile
creation method and use that in plugins that require a tempfile. This
uses a shell script that tries a variety of tempfile creation methods.