Remove empty parentheses from query string.

If you searched for 'Some()' the query produced would be invalid and
would not execute at the database.
This is now filtered out; unit test added.

Fixes bug#9629 - http://bugs.otrs.org/show_bug.cgi?id=9629
"ORA-936 error in AgentTicketSearch with some search clauses"