Dust Production around Carbon-Rich Stars: The Role of Metallicity