lib/xz: fix XZ_DYNALLOC to avoid useless memory reallocations