New Zealand PM resigns