Reland [Modules] Remove unnecessary check when generating name lookup table in ASTWriter
Fixes #61065.
This reverts commit 363c98b2 and relands
db987b95 with fixes from
bc95f273.
The module-related issues surfaced there are fixed in the
previous commit.