Use more robust SQLFreeStmt(SQL_CLOSE) instead of SQLCloseCursor
SQLCloseCursor when called in appropriate time change statement state to
invalid