merge MMcM: Fix check when computing maximum number of rows needed for Limit.

Merge pull request #1156 from MMcM/sql-layer/sort-limit-unlimited
https://github.com/FoundationDB/sql-layer/pull/1156
Make the basic term for a TInstance be "type" in a bunch of methods and local variables.