(#2807) - auto_compaction properly trims tree

I figured out the bug. It turned out we put a `1` as the height of the tree when it should have been `0`, because that value was referring to the max distance from the leaf in order to keep it.

So actually this has been broken for some time, because we only compacted a tree down to its leaf+1 branch, rather than down to the leaf. We also had a broken unit test that was not correctly verifying that all non-leafs are deleted.
Above is the unit test that was wrong. It was verifying that out of revisions `1, 2, 3`, only `1` was deleted. In reality, both `1` and `2` should have been deleted.