catch divide by zero exceptions when calculating rho-k

following the scipy implementation,
https://github.com/scipy/scipy/blob/master/scipy/optimize/optimize.py#L8
81
Merge pull request #191 from stuarth/master

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