Re-enable unit test that throws exception from TaskStop handler

Uncomment `testFailTaskStop()` unit test and fix the task and the driver so the unit test passes. Refactor the `FailTaskTest` suite, and do some minor cosmetic changes to the code that it uses.