sha1-name: make sort_ambiguous_oid_array() thread-safe