Re-use constraints helper in constraints visitor (#14444)
The visit_tuple_type method of the constraints visitor does similar
logic to the new helper for building constraints for typevar tuples, so
we reimplement it using that. This also fixes a bug that was uncovered
in the implementation of the helper.