Avoid reallocs in removeDuplicateAddresses