Be more careful about binding to subquery columns

it should be a column source, from the table we're looking for
merge ScottDugas: Be more careful about binding to subquery columns

Merge pull request #1419 from ScottDugas/sql-layer/constant-cast-as-column
https://github.com/FoundationDB/sql-layer/pull/1419