Close connection when unbuffered result ends.