Add flag to demote error on non-convergence of the solver to warning

If the solver parameter 'error_on_nonconvergence' is True (the
default), non-convgence of the linear solver raises an exception.
If set to False, a user warning is printed instead.