MODE-2297 Corrected how result sets are built from columns when queries use set operations

If one of the queries in a set query uses a join and returned values from only the second selector (e.g., the right side of the join), then the result object was built incorrectly to access the values by the wrong index. This commit adds a test to replicate the situation and fixes the underlying problem.
Merge pull request #1237 from rhauch/mode-2297-b

MODE-2297 Corrected how result sets are built from columns when queries use set operations