Fix #3361, make %% coerce right operand only once

Force coercion of right operand once before doing arithmetic with it in the `__modulo` utility function.
Merge pull request #3362 from epidemian/fix-modulo-coercion

Fix #3361, make %% coerce right operand only once