pub fn write_backup_cursor(wal_dir: &Path, cursor: &BackupCursor) -> Result<()>
Writes the backup cursor to a WAL directory.
Uses write-to-temp-then-rename for atomicity.
Returns an error if the cursor cannot be written.