Improve/extend integration test completion waiting.

Fixes failing TravisCI integration test locally.