Force cleanup before destroying socket

I noticed that we were occasionally not seeing callbacks fire for reads. I then found that there was a 1:1 correlation between occasions where disconnect executed and `this.task` was non-null and occasions where we saw no callback for a read.

This patch seems to have fixed it for us.

Thanks for the library!