Fix testcase for connection leaks to work around uncontrolled pool size

See #1708