fix for nested cursors

presumably you're not using identical sql, so hash the sql and
include it in the cursor name

Change-Id: Iedc3884571d0962b93dc700b9aec03fd1beb88b0
Reviewed-on: https://gerrit.instructure.com/28177
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>