fix overflows in rational comparisons. part of #2960
Merge branch 'master' of github.com:JuliaLang/julia