closeFile() writes a sidecar through a new temporary file and renames it
over the sidecar, so a 0600 sidecar became 0644 under a 022 umask. The
temporary file now takes the sidecar's permission bits before the
rename, as File.copy does for its target.
Test: a_replaced_sidecar_keeps_its_permissions (Unix only) in
crates/engine/src/tests/script_xmp.rs.