http: use an unref'd timer to fix delay in exit

Fixes #5763.