ENH: optimize: handle NaNs in curve_fit

curve_fit now raises ValueError if input data contains NaNs.
Previously curve_fit would return nonsensical results.
Fixes #3422
I might be wrong, but is this not exactly why the check_finite flag exists in linalg? 
And is it too much of a complication to have
```
def curve_fit(...., check_finite=True):
   if check_finite:
         xdata = np.asarray_chkfinite(xdata)
   else:
         xdata = np.asarray(xdata)
   ....
```
With the default being to check, both sets of users are reasonably happy I'd say.