[FIX] Wrap database caching code executed in queues in autoreleasepools
[FIX] Wrap memory caching code executed in queues in autoreleasepools