being defensive about possible HtmlUnit memory leaks