Revisit the implementation of random_default_impl for integer to make sure avoid overflows and compiler warnings.