The mass-loss, expansion velocities, and dust production rates of carbon stars in the Magellanic Clouds