extended the api to keep track of background threads.

Callers using their own background threads are now required to call shardcache_thread_init() and shardcache_thread_end()
when starting/disposing a thread which is going to acces the shardcache API.

On the storage level this is propagated by calling the thread_start() and thread_end() callbacks if present
(allowing to call mysql_thread_init() and mysql_thread_end() as necessary, when using background threads)