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.
Add support to arm64 and fix other Xcode compatibility issues.