Use fromException instead of cast when matching exceptions

Since I added the SomeAsyncException class, we weren't calling the
StackOverflowHook() properly for stack overflows, because this bit of
code was not expecting the extra layer in the hierarchy.