Workaround from chrome array length bug

correctly deletes array elements who’s indexes are greater than the new
array length.