d3dx9: Implement D3DXSaveSurfaceToFileInMemory.