This version fixes a bug in the new flush implementation in confluent_kafka_wrapper that was necessary to work around an issue in librdkafka. Unfortunately, the original implementation did not respect being multi-threaded safe, and would thus encounter scenarios where flush would never return. Fix that by properly checking the number of messages remaining to be produced, in addition to tracking the number of messages produced within each thread calling poll. Also adds a timeout to all flush calls to reduce the impact of any such related bugs.