Add an exception-trapping thread class