C and N abundances of main sequence and subgiant branch stars in NGC 1851