[Sema] Add defensive guard for implicit use of self in closure check
Add assetion along with defensive guard to avoid crashing in release
build. Hopefully, sourcekitd Stress Tester find a reproducer for the
crash.
rdar://problem/47895109
(cherry picked from commit ce30a72e2ae2f45074ce9e76cbcbf94b982df95f)