Fixed CleanupReferencePrefixMapping upgradestep

Works now for reference to no longer existing objects.
Merge pull request #124 from 4teamwork/pg_fix_cleanup_reference_prefix_upgradestep

Fixed CleanupReferencePrefixMapping upgradestep