Fix the LevelDB table configuration, implement compact, avoid a nasty race on shutdown.