Merge pull request #8465 from CookiePLMonster/d3d-common-cleanup D3DCommon: Cleanups and resource leak fix