The canon evidence on this point (as already discussed in the comments, and see the spoiler block below) is slightly ambiguous, but it seems to follow the general principle of Harry Potter magic: that it is sensitive to intent, and tends to act almost as if it were self-aware. Following this principle, I would say that it is the act of choosing to ignore your Vow that results in your death, and that therefore if the Vow becomes moot, as in your example, the spell would have no effect.
As an example of this general principle, Hedwig was able to deliver Harry's letters to Sirius even though Harry had no idea where Sirius was, and in Prisoner of Azkaban she turned up at the Leaky Cauldron five minutes after Harry moved in, even though his departure from Little Whinging was completely unplanned; at the same time, the Aurors couldn't just send an owl after Sirius and follow it, or even post him a letter spelled as a Portkey to take him back to Azkaban. This is because Harry's intent was compatible with the magic, whereas their intent would not have been.
Spoilers from The Crimes of Grindelwald:
Yusaf had made an Unbreakable Vow to track down and kill the son of Corvus Lestrange, but it turned out that Corvus's son had died as an infant. Yusaf did not suffer any obvious ill effects on screen when he learned this - he certainly didn't just drop dead - but the protagonist's (and the audience's) attention was diverted just at that point, so we can't entirely rule out the possibility that he died off-screen. Nonetheless, there was no obvious indication that anybody present expected the result to be fatal to Yusaf, so this is at least weak evidence that a Vow simply ceases to take effect when and if it becomes moot. Also, if it worked the other way, one might have expected Yusaf to have died as soon as the Vow became impossible to fulfill - decades ago - rather than when he found out about it, and we can at least be certain that didn't happen.
One additional caveat:
If I'm understanding the sequence of events correctly, Yusaf's Vow may have already been moot when it was made. It is possible that this means the spell simply never took effect, and that the magic might behave differently if the Vow becomes impossible to fulfill after it is made. That seems less likely, though; if a Vow that becomes impossible to fulfill is considered equivalent to a broken one, it is only reasonable that a Vow that was already impossible to fulfill would be considered equivalent to one you never intended to keep, and if the latter didn't result in your death (or at a minimum some sign that the spell hadn't taken effect) then that would be just too big and implausible a loophole to be taken seriously.