ENH: optimize: curve_fit now warns if pcov is undetermined

Actually, the assert_warns probably needs to clear `__warningregistry__` (a global variable that keeps track which warnings have been raised so far).

https://stackoverflow.com/questions/2390766/how-do-i-disable-and-then-re-enable-a-warning