Fix leaked connections in integration tests Upstream-commit: af5323f9583dbce0f6d8a43a2e442400b9e9b981 Component: engine