leveldb: fixes 'table recovery' and add testing