fixed exception during closing of fully read stream
Merge pull request #160 from romank0/ISSUE_159

fixed exception during closing of fully read stream