Replace get_connection with get_cursor

We don't actually need the more powerful get_connection API for what
we're doing.
Clean up test harness db usage

We were creating too many connections and cleaning up inefficiently.