Cleanup thread local dbcache

These patches removes unused methods and the related variables.