Fix dispatcher not detecting socket close.