Properly dispose of StringReader and StringWriter.