unittests: exit(1) or error

Since #1130 the unittests are executed by Travis CI, the unittests should return an error code if not all tests passed.