ENH: optimize: curve_fit now warns if pcov is undetermined

> The PR also adds a warning for the pcov=inf case.
yes, sorry, that is my mistake. The early failure in case of infs in input is the object of a different PR (#3923), but I branched out this PR from the same master...
Should we move the discussion there?