fix key length checking

according to the kafka protocol, a length of -1 indicates null
Merge pull request #2 from nowgoo/patch-1

fix key length checking