Counterintuitively, wined3d_stateblock_savedstates_set_all() doesn't actually set all necessary state. It only sets the states relevant to D3DSBT_ALL, which is all of wined3d_stateblock_apply(), but wined3d_device_apply_stateblock() has some extra flags that are specific to primary stateblocks.
You instead want to just memset() the entire changed structure to ~0.
Oh, hmm, and then there's lights. I guess you'd need to mark every light contained in the primary stateblock as changed.