Effect of magnetic transition on solubility of carbon in bcc Fe and fee Co-Ni alloys