BUG: Fixes #5376: np.ravel to return same array type