Outside the Book of Vile Darkness (3.5e), which is vague, there are no official rules for becoming a lich, so this is inherently a matter of homebrew. That said, lets consider what the monster manual says.
When a lich's body is broken by accident or assault, the will and mind
of the lich drains from it, leaving only a lifeless corpse behind.
Within days, a new body reforms next to the lich's phylactery,
coalescing out of glowing smoke that issues from the device.
There's no mention of death there- being beaten up and destroyed is probably fine, and won't trigger the soul loss clause. It's worth reading the fine print.
However, there is a catch.
No wizard takes up the path to lichdom on a whim, and the process of becoming a lich is a well-guarded secret. Wizards that seek lichdom must make bargains with fiends, evil gods, or other foul entities. Many turn to Orcus, Demon Prince of Undeath, whose power has created countless liches. However, those that control the power of lichdom always demand fealty and service for their knowledge.
Becoming a lich may mean swearing fealty to an existing great power, which may prevent you from making a deal with the devil, or may supersede your existing deal. You could try to pull a John Constantine, and have both desire your soul and fight over it, but I am uncertain how reliable that plan is.
That said, if you're powerful enough to become a lich, there are safer ways to do this, like the clone spell.
This spell grows an inert duplicate of a living creature as a
safeguard against death. This clone forms inside as a sealed vessel
and grows to full size and maturity after 120 days you can also choose
to have the clone be a younger version of the same creature. It
remains inert and endures indefinitely, as long as its vessel remains
undisturbed.
At any time after the clone matures, if the original creature dies,
its soul transfers to the clone, provided that the soul is free and
willing to return.
Just convince the demon that you intend to do many dark and terrible deals with it in the future, and make sure the contract allows the use of cloning.
You should ask if your DM is willing to import some previous edition types of lich, like the archlich (a good aligned lich). Depending on your alignment, this may be a step to far, since if you're making a deal with the devil you're a bit sketchy to start with. Archlichdom does not require deals with demons.
It's not specified.
D&D 5th edition's Mordenkainen's Tome of Foes is the first sourcebook to reveal that the Ruby Rod was forced upon Asmodeus by Primus, and that devils obey their contracts out of fear of the rod's curse. It's not specified in any other 5th edition book, and the relevant sourcebooks of earlier editions make no mention of this curse either.
D&D 3rd edition's Fiendish Codex II: Tyrants of the Nine Hells defines Asmodeus, the Ruby Rod, and the rules around mortals making a pact with a creature. On page 23, regarding Faustian Pacts:
Though benefits of extraordinary value can be offered in a Faustian pact, the devil preparing it always tries to achieve the deal with a minimum possible expenditure of resources. Once the soul is securely damned, the negotiator often arranges—usually through servitors—to bring about the signatory's untimely death.
Page 25 describes what happens if a soul goes to Baator and demands the right to adjudication on the grounds that their rewards were not granted, or that the mortal was coerced or magically compelled:
The judge, usually a pit fiend, listens dispassionately to both sides and rules, as a lawful creature must, according to the law.
If the mortal wins, their soul goes free and may be restored to life with raise dead as normal. Notably, there's no mention of any curse or penalty which affects the devil who made the pact.
Asmodeus and his Ruby Rod are detailed in this book (p.155-157). There's no mention here of the rod's origin with Primus.
In AD&D 2nd edition's Planes of Law, it's suggested that devils obey their contracts because they are experts at creating and exploiting loopholes in contracts, so the contract is always in the devil's favour (p.20):
They'll cut a deal with any berk they can, and woe to the sod who agrees to their terms — and dire woe to any sod who thinks he can skirt the agreement! The baatezu've been making deals since before most Prime worlds cooled from the heat of creation; they've learned just about all the loopholes.
Best Answer
A Hellfire Weapon might work.
The Hellfire weapon, from Baldur's Gate, funnels the souls of its targets into the River Styx, converting humanoids into devils.
As to how your Warlock would obtain such a weapon, that might become a fun new side-quest.