refs API: add a version of refs_resolve_ref_unsafe() with "errno"