IMPALA-1230: Uncorrelated non-scalar subquery accepted in binary
predicate

This commit fixes the issue where an uncorrelated non-scalar subquery
with distinct in the select list is accepted in a binary predicate. The
issue is fixed by adding a proper check for a distinct clause in the
select list of a subquery when evaluating the subquery's return type
(scalar or non-scalar).

Change-Id: I7a207c89502a6db589d5288aeaf4e54b43122c41
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4316
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: jenkins