The metal–silicate partitioning of carbon during Earth's accretion and its distribution in the early solar system