Kellogg and union officials have signed an agreement on employment conditions at four plants in the US that will see the sites remain open, months after the Special K owner said there could be closures.