nir: Rework nir_lower_constant_initializers() to handle functions