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.
I think it would be perhaps better to use <> for not equal. It seems to be well supported and part of SQL.