HIVE-8017: make KryoSerializer thread safe