Na-O anticorrelation and horizontal branches - IV. Detection of He-rich and He-poor stellar populations in the globular cluster NGC 6218