refs.c: commit_packed_refs to return a meaningful errno on failure