Information about sponsors
Improve the query for exporting tickets to SQLite

Using RT::Tickets without using FromSQL often leads to ugly and
unexpected behaviour due to the internals.  While that underlying
problem should be fixed, it isn't happening anytime soon.

By switching to a combination of FromSQL and the explicit "vanilla"
versions of Join/Limit, we pick up the standard set of limits that
FromSQL implies:

             Status != deleted
    AND EffectiveId  = id
    AND        Type  = ticket

The status limit prevents "Deep recursion" warnings triggered by
RT::Tickets::Next skipping over deleted tickets in long runs.  The other
two limits improve the accuracy of the export by eliminating tickets
merged into other tickets and not counting reminders or approvals that
may have strayed into the database.

While the switch from Join/_SQLLimit to the RT::SearchBuilder:: versions
is not strictly necessary, I think it enhances the explicitness of
what's effectively happening and avoids touching the "ticketsql"
subclause added by FromSQL.
Mark the ticket export query join as distinct to avoid a performance penalty

This eliminates the need for a temporary table.