Union officials have reached a deal with Pick n Pay to save 2,000 jobs at the South African retailer.