wined3d: Move some UnLoad code to the base texture class.