Adjust loop counters in word break detection when removing item

Bug: 63333
Change-Id: Ie00e7f8eb5ce41b19f0df9977eee2916d6761b93
(cherry picked from commit 9eb38109d38d28cd5fe06f036a9717b686dae01c)