Better timeouts in completion tests

- Increase timeouts to 3 seconds
- Implement waiting for completion in a way that it detects when pane
  contents have changed instead of waiting for a fixed amount every time.

Hopefully fixes failures such as:
- https://travis-ci.org/github/hub/jobs/14369618
- https://travis-ci.org/github/hub/jobs/14369403
Merge branch 'completion-timeout'