fix kafka key NPE and consumer close exception