http: fix multiple timeout events

Fixed up slightly by @isaacs so as not to miss 'timeout' events in some
cases.