Change raw_svector_ostream to reserve the input buffer if necessary, Ted was