nir: Split nir_lower_io's input/output/atomic handling into helpers.