Try to apply each hunk individually. Hunks that apply cleanly are applied;
hunks that fail are inserted as conflict markers at the expected location.
Returns the result text — never fails.
Sanitize a path from a patch file: strip leading separators, reject .. traversal,
and normalize backslashes to forward slashes for cross-platform consistency.