Process typedefs last

Becasue typedefs sometimes use namespaces that are actually
constructors, we need to process typedefs after symbols to avoid
duplicate entries for such namespace types.
Merge pull request #2635 from ahocevar/typedefs-after-symbols

Process typedefs last when generating externs