mesa/st: make sure we remove dead IO variables before handing NIR to backends