optimize merge progress

before the merge progress will write the result file twice, the first time it just saves the normal result xml without 'environment node' and 'device info', the second time it will add these info into the result xml.
and it will cost extra memory during the second save.
so now these two saves are combined to one save to reduse memory usage