Make failed tests return proper exit/status code

I was hoping that there was some kind of magic that made the test runner
call sys.exit in the same way the .main call does, but apparently not.
Would be silly if it did anyway.