TestHelper: Return failures

If we return the number of failed tests the invoking process gets more
information about what happened. Furthermore it is a performance
improvement because we don't need to calculate retval in every loop.