Former Canadian envoy to Washington defends work pitching for Palantir