get_short_oid: sort ambiguous objects by type, then SHA-1