If tmpfile() fails, try to make a unique file with tempnam() and getpid()
If tmpfile() fails, try to make a unique file with tempnam() and getpid()

On systems where tmpfile() does not work, we try to fallback on
using tempnam() and fopen() to get a temporary unique file.

However, tempnam is not enough to get a unique name. Between
getting the name and opening the file, something else also
calling tempnam() could get the same name. It has been observed
on MinGW-w64 builds on Wine that this exact thing happens
if multiple instances of a unit tests are running concurrently.
To prevent two concurrent unit tests from getting the same file,
we append the pid to the file. The pid should be unique on the
system.

tarruda/check,tarruda/check,tarruda/check,tarruda/check,tarruda/check