Close the stream when the client disconnects