d3d9: Introduce a d3d9_texture_cleanup() function.