[Form] Fixed undefined index in writeProperty when saving value arrays

When removing an item from an array and the previous value contains more than one identical copy of that item, the second unset fails with undefined index.