Second attempt after http://llvm.org/viewvc/llvm-project?rev=296166&view=rev
In the first attempt, Code (the memory buffer backing the input file) was reset before overwriteChangedFiles() was called, but overwriteChangedFiles() still reads from it.
This time, load the whole input file into memory instead of using mmap when formatting in-place.
(Since the test is identical to what was in the repo before chapuni's revert, svn diff doesn't show it – see the above link for the test.)