When running tests from command line, set exit code appropriately.

Excited to hear that a release is upcoming... motivated me to make two little fixes (hardly substantial, but I noticed them, and I'm pedantic that way)

This change makes the test suite exit with error code 1 if the tests failed, which is potentially useful for e.g. continuous integration and such.