Mark socket as closed when onDone is called