Package atomicwrite provides a POSIX-atomic file writer: data is written to
a temp file in the target's directory, fsync'd, then renamed over the target.
Write atomically writes data to path. It creates a temp file in the same
directory as path, writes data, fsyncs the temp file before closing it, then
renames the temp file over path. The temp file is removed on any error so a
failed write never leaves partial state behind.