effects: Introduce a helper for referencing deleted windows
If an effect is reloaded while it holds deleted references, it's possible that the closed windows will get stuck in the "zombie" state.
This change introduces EffectWindowDeletedRef helper that can be used to keep the closed window alive as long as the reference is valid.