writeFile
Writes a replacement file without truncating the previous payload; logs and returns a storage error on failure.
Atomically writes a payload, logging failures before returning the shared storage error.
Replaces a payload file and classifies write failures where the OS error is available. Returns null on success or StorageError on failure. Only writes use this contract because a failed save can silently stop proxy message delivery.