Effects of tick population dynamics and host densities on the persistence of tick-borne infections