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

See commit message for details.
@charris, I've added a note in the docstring about the update in v1.10.  Can you check it to make sure that's what you meant?