Fix random crash and memory leak. Apparently, soci doesn't like when the rowset is used while the session is deleted.