Fixed an UnboundLocalError in lib/cache.py

Not much to say about this. I guess nobody's tried to index a LRUCache
recently.