Keep track of all symbols

This avoids that we add parent namespaces of symbols that were already
added because they have their own definition in the externs.