Change test for overflow to not use undefined behavior (relative to
C++ standard) for signed integer types.