texture: fix texture reloading when gl context changes (was not working anymore with latest texture optimizations)