mesa: rework Driver.CopyImageSubData() and related code