Includes some loop condition fixes after fuzzing.
The previously identified regression (#43641) is now fixed upstream.
(cherry picked from commit 1bb6491992)
Should fix issues some of us have with `misc/dist/uwp_template/AppxManifest.xml`
always showing up as modified.
Might cause issues on Windows due to the removal of BOMs or change of line endings
in some of the Mono, UWP or gradlew.bat files, we will test and adapt if need be.