Absolute path to the target file.
Content to write.
Optional file mode for the written file.
Retries the rename up to three times on EPERM (Windows file-handle contention) with a 100 ms synchronous delay between attempts.
When options.mode is given, the temp file gets exactly that mode before
the rename (so a secret-bearing file is never visible with wider
permissions); on Windows only the read-only bit is affected.
Write content to a file atomically via a temp file + rename.