use isinstance instead of duck-typing

This follows @astrofrog 's suggestion in the comments. Might be safer here.
The implementation can eben be a little shorter, since `np.ma.array`
and `np.rec.array` also subclass from `np.ndarray`.
Just s before, this passes the tests locally, so we'll need to see
what Travis says.