Ailing US poultry giant Pilgrim's Pride has won court approval to gain access to funding to ensure the business can pay its staff and suppliers.