Tests: fail with exit code.

When running tests programmatically, it's nice to have test failures
cause a failure exit code from the test runner.  An easy way to do that
is to set the exit code to the number of errors that have occurred.