Total and unions reach deal on oil refinery wildcats