You keep the benefits of a template if you lose the prerequisites for it, but that's not really the situation you're describing here. What you actually want to know is whether any physical or magical changes to your form that occur while you are polymorphed will carry over to you after the morph ends. Entirely different question, and one that is, in fact, moot, because you can't polymorph into an undead unless you are one already, at which point there's no need to resort to such shenanigans, since you can be spellstitched in your normal form.