Make tempnam play nice with open_basedir restriction on.

Fixes #607