Pass thread-local SparkEnv to KryoSerializer