[Effects] Ensure that we properly substitute function types in ByClosure checks
We weren't substituting generic arguments into function types. In the
presence of parameter packs, this could mean that the parameter and
argument lists no longer match up, which would cause the effects
checker to prematurely bail out after treating this as "invalid" code.
The overall effect is that we would not properly check for throwing
behavior in this case, allowing invalid code (as in the example) and
miscompiling valid code by not treating the call as throwing.
Fixes rdar://153926820.