encoding: Rework xmlByteConsumed Don't loop infinitely if input buffer is too large. Allocate conversion buffer on the heap.