nir: fix nir_shader_clone() and nir_sweep()