[PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!

Makes sure that a deserialized macro is only added to the preprocessor macro definitions only once.
Unfortunately I couldn't get a reduced test case.

rdar://13016031

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172843 91177308-0d34-0410-b5e6-96231b3b80d8
6 files changed