Bind `socket.end` to the `socket` object.