A court in Saudi Arabia overturned a death sentence against a Palestinian poet convicted of apostasy, giving him eight years in prison instead, his lawyer said.