A density-dependent interaction in the folding model for heavy-ion potentials