catch divide by zero exceptions when calculating rho-k in fmin-bfgs

following the scipy implementation,
https://github.com/scipy/scipy/blob/master/scipy/optimize/optimize.py#L8
81