multi-instances: fix a possible null dereference in xmp writing