Avoid crashing when incorrect exception is thrown.

It seems that although the exception is stored in a block variable, it’s
being freed after the @catch block ends its scope.