nir: add and use nir_variable::index and nir_index_vars()
This will also be useful for !1240 (merged) to deterministically use variables in hash map keys
This will also be useful for !1240 (merged) to deterministically use variables in hash map keys