Make use of PyLong_AsLongAndOverflow in math_ldexp.