[BZ-986465] avoid infinite loop when removing a rule containing a sliding window