BUG: optimize: fix negative curvature search direction in _minimize_newtoncg

When the CG iteration fails on first iteration, the algorithm should
pick the steepest descent direction pk = - c grad(f) with c > 0. There
was a sign error here which made the choice to be pk = + c grad(f),
which caused the line search to always fail.
TST: optimize: add a test case where minimize_newtoncg used to fail