nir: Add a nir_foreach_variable macro