Copy StringIO properly