fix(consumer): ensure statements are always closed

What does this MR do?

Follow the recommendations for the ClickHouse Go client and ensure we always close the batches. In case we returned early between PrepareBatch and Send because of error we did not release a connection.

How do I test it?

Tests pass. It still worked in the sandbox environment.

Merge request reports

Loading