(PUP-1073) Fix detecting alias collisions

Making the uniqueness_key more complex than name for packages means that
testing whether name matches title is an insufficient test for whether
to check if the resource is defined and add an alias. Now if the
resource is isomorphic and the uniqueness key is not the resource's
title, add an alias.