add some numerical handling to Pow imaginary/real handlers

When the argument of the base of a power is a rational number, detecting real or imaginary values is possible. This processing was added to Pow._eval_is_imaginary and Pow._eval_is_real. In addition, a quicker exit was implemented.
I should leave this as `if all(a.is_complex for a in self.args): return True`. I don't know what it will be if an arg is not complex. I don't even know what such an object might be and how it would be used in a power (though I know that matrices can be exponentiated).