Merge "applypatch: Fix the checking in WriteToPartition()."