Fix Ref-Counting Error in Versions

Fixes #136. References to a DBImpl's VersionSet can be left in the
LRUCache, so delete the cache before the VersionSet.

Also stores the current version a local variable when references several times in a function to avoid race conditions.