validate_headref: use get_oid_hex for detached HEADs