[PATCH v2 3/4] d3d9: Add reference counting helpers for textures.