pipelet.js, query_tree_emit(): prevent duplicates, add test in xs_tests.coffee