OFDeflateStream: Fix tree construction.

When a bit length had more than 255 occurrences, it caused an integer
overflow and thus a corrupt tree.

This also cleans up tree walking.