Ireland respond to a first home defeat in more than three years with a 22-19 win over Argentina at the Aviva Stadium despite twice being reduced to 14 men.