Explicitly clear return references for connection, session and cursor
open, it's just nicer.  Don't clear conn->default_session until there's
a valid replacement, underlying functions use it, it's dangerous to pass
it in as the memory location to store its replacement.