fix memory leaks in the regression tools; add another close detection test that validates that there are no dangling connections on the server svn:r969