Carefully replace aliases to prevent duplicates.

This prevents duplicate results when searching across both content and
non-content namespaces during a reindex.

Bug: 53484
Change-Id: Ieb897fde4963add14f861f1544d565a67fdaa18e
Merge "Carefully replace aliases to prevent duplicates."