ddraw/tests: Test state application on multiple devices.
ddraw: Factor out d3d_device_apply_state().
ddraw: Correctly apply state when multiple devices are used.