inv_as_solve optimization checks if op is Dot

Previously it checked if node.op == dot where dot was a dot function
I assume that this was a mistake

I've changed this to check if isinstance(node.op, (Dot, Dot22))
I've also added a test
Merge pull request #1283 from mrocklin/matinv-solve

inv_as_solve optimization checks if op is Dot