Use Stream#closed? if it's already defined.
Merge pull request #891 from DamirSvrtan/master

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