Fix handling object ownership in msLoadMapFromString (#4551)