Improve x_unlink's temporary filename

The XXXXXX part was unused.
Don't leak log file descriptor to executed commands
Improve error reporting when failing to create stdout/stderr file in execute()
Handle disappearing temporary stdout file gracefully

If the temporary stdout file has disappeared, it's most likely because
another ccache process is doing cleanup on a too small cache.