llvm_tools: Fix patch_utils patch writing

There were two bugs with patch_utils here:

1. When deciding to modify patches, it didn't ignore old patches.
2. When writing out changes, it wrote the dicts out in the wrong
   order.

Both of these issues have been resolved.

BUG=b:253660089
TEST=./patch_utils_unittest.py
TEST=./patch_manager_unittest.py
TEST=./update_chromeos_llvm_hash_unittest.py
TEST=./update_chromeos_llvm_hash.py
TEST=./update_chromeos_llvm_hash.py \
	 --is_llvm_next \
	 --llvm_version tot \
	 --failure_mode disable_patches

Change-Id: If25c30ffa2bea55aeafb8d03aa19c5fc07fb4b7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3956311
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
1 file changed