XmlReader: close streams and readers

This fixes Issue #786