tempnam(3) is insecure, not recommended to be used, marked as obsolete
in POSIX.1-2008. In fact, pseudo(1) fakeroot replacement for
OpenEmbedded, blocks the use of tempnam(3) and tmpnam(3) hardcoding them to return ENOMEM.
Reimplement tempfile using mkstemps(3), performing directory selection
according to tempfile's manual page.
Update the manpage accordingly.