[modules] Fix iterator invalidation issue with names being added to a modulewhile we're writing out the identifier table.llvm-svn: 231890