[Bug 36670] valgrind shows invalid read/write in d3d8/tests/device.c