updated the api a bit to make memory management safer (and cleaner)

now shardcache_get() returns a copy of the value stored in the cache (or in the underlying storage)
and callers are required to free the memory returned when they have done with it.

We can't avoid copying the returned data because while the caller deals with it , someone else might
evict the cache or even completely remove the data from the underlying storage
fixed some leaks happening at destruction time

even if not vital (since were happening only when the shardcache instance was being shut down)
war really annoying to see them reported by valgrind
ensure thread-safety

even if the hashtable is thread safe , it can still happen that
we override or remove a value while the 'fetch()' callback is still copying
the actual memory to return it to the caller.
If this happen, that memory could be released while the copy is still in progress
so we need to synchronize accesses to the storage callbacks to avoid such race conditions
fixed a race condition reported by the thread-sanitizer
no need of using two mutexes here
updated to conform to the recent changes