Use lexical contexts when checking for conflicting language linkages.

This fixes pr14958. I will audit other calls to isExternCContext to see
if there are any similar bugs left.