replmd: keep links sorted in replmd_process_linked_attribute