Fix runaway threads in kafka_consumer agent plugin

Change-Id: Ie40bdddede3a424fb7f27a8a54bcbcb391c82b2f