Use iterable(expr) rather than hasattr(expr, '__iter__') in together()

The difference is that the former excludes strings and dictionaries.

Related to #2750.

Unfortunately, I don't have a good test for this. The expression from #2750
breaks in a new way. They are both related to the matrix expressions objects
containing strings in their .args. And even if that worked, they would not
test this fix if that behavior ever changes.
Merge pull request #2771 from asmeurer/together_iterable

Use iterable(expr) rather than hasattr(expr, '__iter__') in together()