leveldb: fix slow version purging

Came out of issue #20.