Fix #5072: hash(Integer) should return the int

fix #5072

@smichr, please take look on changes in add.py.  \_addsort and \_mulsort were introduced by 8942676.  Why cmp_to_key(Basic.compare) wasn't used as a key in both places?