TIKA-1322: Properly close XMLParser's output in case of SAXException.

Fix and test for https://issues.apache.org/jira/browse/TIKA-1322.