fix closures which always throw. (#25278)
Summary:
When a closure was declared that always throw'd we would erroneously propagate the ExitThrows status to the block in which it was declared, causing us to remove the subsequent code in the block. [this code](https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/script/exit_transforms.cpp#L462) was meant to handle this case, however it didn't handle the case when we were transforming Loops and the prim::Function wasn't a target block.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25278
Differential Revision: D17084780
Pulled By: eellison
fbshipit-source-id: ee31a4cc243653f615e4607ece29cdac8ef5710e