leveldb: db_compaction: cleanups and simplify the logic