Probe cargo for -Z json-target-spec support instead of guessing from the version (#12726)