SPARQL: fix bug in DISTINCT in combination with UNION