Fix the race condition in tests.
Use coveralls only on travis-ci.