C iv absorption in damped and sub-damped Lyman-alpha systems: Correlations with metallicity and implications for galactic winds at z~2-3