ENH: More general boolean comparisons for complex_ops.h. Fix gh 2603.

Changes the boolean comparisons to function template. Fixes ambiguity errors/warnings while compiling, like in [this issue](https://github.com/scipy/scipy/issues/2603).