Some Democrats running for governor spent money boosting their far-right opponents ahead of the primary, thinking they’d be easier to beat in the general. The strategy is riskier in swing states.