wined3d: Move the surface map counting code to wined3d_surface_map().