BUG: make curve_fit() work with array_like input.  Closes gh-3037.