safe_cast: move the double -> int specialisation into mp_integer, as we
use integer for the conversion.