New Zealand's intelligence chief has warned of the risks posed by China's growing influence in the Pacific, prompting a stern rebuke from Beijing.