Search Result Pagination Fix For Postgres

It does this by using a offset parameter that doesn't lose precision.
This breaks compatibility with Ruby 1.8.7 by using a Rational.

WP [#2616](https://www.openproject.org/work_packages/2616)

Change Log:

* `#2616` Fix:  Search: Clicking on 'Back' results in wrong data