egl/dri2: move surface refcounting out of the platform code