it avoids looking up the stream, which will be null when closing the
connection.  Updated the comment.