ferristseng made me notice that you cannot close streams/iterators
properly. This commit now gives proper closing functionality on
streams/iterators for the underlying input stream. Thanks, ferristseng!