It might be too late now, but I've successfully negotiated (before signing) retention deals like this to be pro-rated in the event of non-voluntary termination. It's perfectly reasonable for exactly this reason, and companies have no legitimate reason to deny it.