close more refcursors
Revert "use buffered queries"

This reverts commit 665607da55a4e54719f4e7e6b7e02da8a8bd5058.