Don't hold the queue lock for too long

This creates a local-to-pruner-job queue -- and the actual cache queue is
cleared. After the pruning job is done, the remaining list is appended to
the cache queue. Since destroying cache entries might take some time, this
gives us some time in the main I/O threads while doing potentially
time-consuming operations in the low priority job thread.

The hash table lock is also locked only when there's a need to perform
destructive operations in the hash table. This should help if there's people
trying to get stuff from the cache and there's a large amount of items that
need to get destroyed.
Add note about RCU/liburcu in TODO
Use ATOMIC_BITWISE() instead of directly using __sync_* builtin