fix infinite loop regression in 1.4.18

Seems that a closed connection can fire off extra events sometimes? There
might still be another bug lurking.