Perf UI Bench Testing Code for vm infrastructure page

This code navigates to VMs/Templates and records page load times out of production.log.  When the appliance has rails debug turned on, it will record the number of select queries (cached/uncached).  

There are a few issues/assumptions with the code currently that I'd like to get worked out:
* Rails debug will work best on an appliance with only the UI role, as queries will become chatty in production.log and parsing production.log will consume large amounts of time.
* Appliance under test is pre-provisioned and loaded with a db or connected to a db appliance with data already on it.
* One MiqUIWorker on the appliance under test.

The output is logged to cfme.log and in a csv file to build charts from.  Ideally, charts can be generated of the most relevant ui pages to check using pygal or some other graph generating python module.  Pass/Fail criteria is checked per page load inside analyze_page_stat and logged as a warning.
What guarantees, if any, are in place to ensure that this SSH connection is closed when it's no longer being used?