updated to latest libshardcache

and use shardcache_thread_init() and shardcache_thread_end() when necessary