Yes, the legal route sounds at least plausible. I don't know if there's any precedent or how reliable such a contract could be made.
Re:Firebase is Joining Google
by james_in_the_uk on Tuesday October 21, 2014 @05:43PM
(#8490263)
It's not plausible because insolvent / bankrupt companies have the option to walk away from onerous contracts if it is in the interests of the debtors not to honour them. In this case, the idea of open sourcing the software UPON bankrupcy could destroy any remaining value left in the business (value of IP) which would otherwise be realisable to distribute to debtors.
The couple of small companies that I have worked for that had such a pledge took it seriously. They would hand source for every release over to an escrow company ensuring availability after company death.