[Modules] Do not diagnose missing import in recovery mode if there isn't a decl to lookup
[Modules] Do not diagnose missing import in recovery mode if there isn't a decl to lookup

Clang often tries to create implicit module import for error recovery,
which does a great job helping out with diagnostics. However, sometimes
clang does not have enough information given that it's using an invalid
context to move on. Be more strict in those cases to avoid crashes.

We hit crash on invalids because of this but unfortunately there are no
testcases and I couldn't manage to create one. The crashtrace however
indicates pretty clear why it's happening.

rdar://problem/39313933

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@332491 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 96b95b50a90a50c5b2e381cbad2d52ea7d832eb5)

apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang