optimize.leastsq should allow for ValueError when inverting curvature matrix

optimize.leastsq should allow for ValueError as well as LinAlgError when inverting curvature matrix.  That is, the code around line 413 should read
          try:
                cov_x = inv(dot(transpose(R),R))
            except (LinAlgError, ValueError):
                pass