Even though there is lawful and unlawful divide about things and actions, the ultimate rule is that normal laws are for normal situations and circumstances therefore under normal siutation and ciurcumstances what is unlawful is unlawful including suicide.
However not all situations and circumstances are normal for everyone everywhere therefore, it is up to individuals or society to decide whether the rules of the game have changed or not.
For example under normal circumstances one cannot kill anyone but when attacked one is allowed to defend and in that context killing of the attacker is no sin if that is the only way for the attacked to survival.
Same with food that haraam become halaal when situation dictates.
Islam has laws regarding three situations;
laws that are private for individuals ie things between man and his god. So long as a matter does not affect anyone else in any way, it is one's own business.
2)Matters between individuals and their god relating social conduct. Two people do with each other whatever they like it is between god and them and nothing to do with legal authorities in the land. Two people fight each other and make up and do not go to police to report the incident then that is the end of matter.
3)matters between individuals and their god relating social conduct as well as law enforcing authorities in the land. Matters like birth, death, marriage, divorce, killing, robbing etc etc are not personal because such things need legal proofs for proper functioning of a society for various purposes. Society is an organisation or an association hence the rules and regulations for organisational purposes.
Therefore suicide is only sin if it is intended for wrong reason not otherwise. A perons sees a kid in the road and sees a car coming which is going to crush him and dives to save him and dies in the process is not a sin. So the intension and purpose or motive behind going for one's death decides whether one has sacrficed one's life or merely taken it away.
If one is in pain beyond one's capability to bear it, then suicide would not be sin because one is not taking one's life merely for sake of it or happily. Sin is only there when one does something with intention of sinning. Likewise intentions, situations and circumstances are between god and the person acting therein.
Just thought that one is going to die if one does not get the food and one is not aware of getting the hallaal food, is enough to turn the unlawful lawful for the person. You don't have to actually die to prove to youself that you were really in need of it.