Set failure/error properties on JUnit task before adding tests.

The JUnit task applies failure and error properties to individual tests as they are added to the task. Moved the setting of these properties on the task so it happens before tests are added, so that we can properly detect failed tests and abort.