Consistency of cross-validation when the data are curves