[bug 868403] Fix OverflowError in smart_int

It's a quick fix. Check out the test.

r?