Restore compatibility with kafka-python.

Kafka-python introduced changes that broke backward compatibility in
4abf7ee1fbbdc47c8cb7b35f2600e58f1f95e6bb, this commit fixes the
problem.