Avoid an infinite loop in the right-strip loop.

If the remaining word is not in the dict, the loop doesn't terminate.
So terminate it if the same remaining word is seen again.
Merge pull request #29 from ampli/loop

Avoid an infinite loop in the right-strip loop.