Atomic file writes on POSIX.