Re-enable unit test that throws exception from TaskStop handler

Fixes #826.
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.