Data from: CRISPR-based herd immunity limits phage epidemics in bacterial populations