[Serialization] Mark decls that can never be cross-referenced (#17301)
This allows us to filter them out in cases that would otherwise be
ambiguous. The particular prompting situation looks a lot like the
test case: a protocol, plus a forward-declared class with the same
name. (Normally we ignore forward-declared classes, but SourceKit's
module interface generation feature makes dummy ClassDecls for them
instead.)
https://bugs.swift.org/browse/SR-4851
(cherry picked from commit 05d0a2dfefcdfd0c6feeef1840337885e4bfce87)