Fix execution of query with conjunction of disjunctions

SQL store of SMW tried to execute (a OR b) AND (c OR d) query like
(a OR b) AND c AND d (where a, b, c, d are some query terms).

This patch fixes it.