set and reset statement handle is_opened flag