Remove slow array_unique from ReferencedEntitesFinder

The array in question is filled with EntityIds, which are expensive to compare.

Change-Id: I08898a36f8582aec3560216ab48da94a465911ca
Merge "Remove slow array_unique from ReferencedEntitesFinder"