tgsi: clean up tgsi_scan_shader() function