SI-7011 Fix finding constructor type in captured var definitions

If a captured var was initialized with an empty tree then finding
the type of the empty tree was being handled improperly. The fix is
to look for primary constructors on the tree's type symbol rather than
the tree's symbol.

A test is included. In order to make the problem more testable the debug
logging of the issue is changed to a debug warn.
Merge pull request #1956 from JamesIry/SI-7011_2.10.x

SI-7011 Fix finding constructor type in captured var definitions