More than 30 pilot whales that washed up on a beachfront in New Zealand have been safely returned to the ocean by hundreds of people who lifted them on sheets.