use a threadlocal for kryo serializer