1.2dev: Remove unnecessary `cursor.close()`
1.2dev: Remove unnecessary `cursor.close()`

For code that is not part of the transaction, move
it out of the transaction block.

Refs #12120.


git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@14680 af82e41b-90c4-0310-8c96-b1721e28e2e2

walty8/trac,walty8/trac,walty8/trac,walty8/trac