Be more selective about adding CAST to the top-level of an INSERT / UPDATE

Previously it would be attempted on all Project that happened to be in the tree.

Review should pay particular attention to the change in the existing union-9 test. UNION of a VARCHAR and an INT is being inserted into a VARCHAR. This should first convert the VARCHAR to INT and then back to VARCHAR. Previously, it was anything through. We now behave as SQL Server does (Postgres rejects the UNION as not compatible.) I believe that this is standard.