I guess I personally disagree with this, at least for my own personal utility function. I would prefer suicide over a lengthy prison term, and I think that's the rational choice, at least with the inhumane conditions in American prisons. And you have to make that decision before sentencing, unfortunately, because courts often order suicide watches around the time of sentencing, precisely because many people share that preference.
I agree with you in cases where you have an option of continuing to live as a free man, however. In those cases seeming dead ends are usually irrational, borne of depressive pessimism. And treatment can make the situation improve and make it clear that there are ways out. But a lengthy prison term is an actual dead end, and treatment can't produce ways out of it. When someone kills themselves to avoid torture, it's the fault of the torturer.