egl/drm: Move loop vars inside the loop