Generalize and cache the "closure effects" determined from the closure body.
Use this to enable better detection of async contexts when determining
whether to diagnose problems with concurrency.
Part of SR-15131 / rdar://problem/82535088.
(cherry picked from commit c3b6160af839732c4f55a7303aab9eb6f2c13cf0)