in XML::Writer prevent writing to io while being GCed
Merge pull request #79 from brettg/write-io-close-stream-fix

Fix IOErrors from using XML::Writer.io