[fix test] ensure underlying connections close so test ends