Electronic transport properties of carbon chains between Au and Ag electrodes: A first-principles study