lzma: fixed bug in encodeBit

The transformation from bit to uint32 typed arguments for encodeBit has
been done wrongly. This commit fixes that. There is an additional
renaming of a loop variable in treeDecode to be more clear that this
isn't the same sequence than in treeEncode.