[PATCH v2 3/8] d3dx9: Refactor texture creation and cleanup in D3DXCreateTextureFromFileInMemoryEx().