Use Stream#closed? since it's already defined.