adding support for .xz with mode="ab" for appending to xz-compressed files