Return TypeError for comparisons, if self or other is not real

I noticed that #7792 makes `I < x` raise an error.  But `x < I` is unevaluated.  Here's an attempt to fix.

Also, add tests.