BUG: comparison of category vs np dtypes buggy (GH8143)

closes #8143