wined3d: Make sure we are still using the correct window before setting pixel format.