Only supply LIMIT hack when necessary.

The hack of supplying a LIMIT of maximum BIGINT is only necessary when
an OFFSET is specified. This patch avoids the hack when it isn't needed,
since it just creates noise and confusion in the SQL logs.