[libvirt PATCH 2/3] Use virBufferTrimLen when applicable