Use enclosed-exceptions to implement safeTry

I haven't been able to get a reliable reproducing case yet, but we had
some code where some failing test cases ended up bringing down the
entire test process. I can't be 100% that this solves the problem, but
I've run the test suite multiple times with this change, and everything
seems correct.

This seems to have come from the fact that we're using the async
library, and the race function in particular, to have multiple
concurrent actions running in our tests. (I can provide more details if
relevant.) async was using AsyncException to kill threads, which was
somehow propagating too far.