IMPALA-1301: Invalid rewrite of uncorrelated scalar subquery when outer
expr is in both sides of binary predicate

This commit fixes the issue where an invalid rewrite is performed for
scalar uncorrelated subqueries that participated in a binary predicate
in which columns from the outer query block appear in both sides. We fix
this issue by rewritting the subquery using a cross join and placing
binary predicate in the outer's WHERE clause.

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