Make Kryo threadlocal in message serializer.

Re-using the kryo instance prevents a lot of object creation.
Merge remote-tracking branch 'origin/master'