The Pacific islands of New Caledonia vote to stay part of France, but by a tighter margin than expected.