core/colorspace: be more robust about edge cases
xyz -> xy and xy -> xyz conversions have divisions in them, so we need to handle the edge cases of the divisor being zero. This can happen if an ICC profile is invalid, or if the XYZ color space is used.