This fixes a race condition in the Weak and Soft reference caches.

o Get-or-put now guards for GC collecting the reference while we are handling it
o Consolidated Soft and Weak LRU caches into one parent class and factories instead, reducing duplication.