Fix logic error optimizing "icmp pred (urem X, Y), Y" where pred is signed.
Fixes PR16605.