Yes, that's definitely an issue with my company. We serve a pretty small niche and provide services to a few well funded competitors, I've gotten a few acquisition offers that would have really hurt my other customers if the deal went through.
Since it's a core feature but not a differentiator for their businesses I'd love to just make all of it open source and charge all of them to keep maintaining it but there's not an easy way to do that currently without devaluating it.
Code escrow and SaaS escrow are both guarantees that exist. Larger customers can negotiate it if they aren't sure what will be the future of the company. Redis (back when they were called RedisLabs) used to offer that for their proprietary components several years ago, although in hindsight it clearly wasn't needed in their case.
Sounds like a cool startup idea -- a company like codekeeper.co but for documenting and open sourcing a product given they go poof. All the legalese that would entail and integration with source control included, of course.
The bigger risk however isn't just that a company goes poof, but that the IP gets purchased for pennies on the dollar by some other company. This is an escape hatch that I don't think many investors would give up willingly.