fix sql_conn_ptr release issue for closed conn