Ticketsearch not flags

... and use it in AgentTicketLockedView, which currently rather clumsily does a search for `TicketFlags => { Seen => 1 } }`, and then reverses the search result in Perl code.

I've only tested it on mysql, and this seems to be the only OTRS code that uses a LEFT JOIN, so please test on the other database systems before merging.