libm: Avoid left-shifting negative integers.