closing query results properly

all kinds of query result should be properly closed before closing the connection itself
Merge pull request #3 from boyankukushev/master

closing query results properly