Fix EZP-23037: multiple JOINs in Subtree criterion

JIRA: https://jira.ez.no/browse/EZP-23037

Problem: 
Subtree criterion is used in content search for user roles/permissions in policy and role assignment subtree limitations.
Given enough limitations, this will cause many JOIN clauses on simple content searches.
Depending on conditions, the above can cause severe performance degradation leading to MySQL timeouts (queries not finishing).

Since it seems there is no actual need for multiple joins, and the where conditions can all be done on the same table, this PR replaces the "unique table name join" with a single join clause on the contentobject_tree table, by looking at the existing aliases in `$query`.
@andrerom: I don't believe its perfect either, but it seems to me any alternative would involve a lot more effort / engineering (also, this can be cleanly backported to EzcDatabase).
Still, any suggestions are welcome.