Accuracy criterion for the mean-field approximation in susceptible-infected-susceptible epidemics on networks