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

See commit message for details.
@charris, are you asking if we even need to use ravel here?  I just tried replacing `data = ravel(asarray(a))` with `data = a`, but running the command:

    python3 runtests.py -t numpy/core/tests/test_multiarray.py:TestBinop

causes an infinite loop throwing up a max recursion depth error.  

In fact, an infinite loop also happens if you call `asanyarray(a)`, and since `ravel` now calls `asanyarray` instead of `asarray`, I had to add `asarray` here.