LP#
1847805: Use WITHOUT HOLD cursor
If we're not inside an explicit transaction, we start one ourselves so
that we can use WITHOUT HOLD cursors. Unfortunately, WITH HOLD cursors
can create large temp files which may be an attack vector.
The commit also includes leak avoidance for the cursor_name string. It
is now a single global variable, which is safe in the current code
because fleshing sub-calls occur after the full set of results are
retrieved at the current level, allowing any implicit transaction to be
closed.
NOTE: Using cursors could allow us to interleve fleshing sub-calls which
could allow a faster TTFB, but cursor names would need to live on the
stack rather than be the new single global.
Signed-off-by: Mike Rylander <mrylander@gmail.com>