improve connection termination tests
Refactor test code.  Increase timeout on first DB-tests because Travis (free) is apparently quite slow.