This changes rustfmt to return exit code 4
when run with write mode diff and differences between
the formatted code and the original code are found.
Useful for CI to make sure your contributors actually ran rustfmt.
The old behaviour stored everything in memory until we were finished. Now we write as soon as we can.
This gives better behaviour when formatting large programs, since there is some progress indication. It also opens the door to optimising memory use by not storing everything in memory unless it is required (which it still might be). That is left as future work though.