idevicebackup2/idevicebackup: Remove code duplication and use common code for reading/writing plist files