KAFKA-1498 Misc. producer performance enhancements. Patch from Guozhang.