Constraints on charm-anticharm asymmetry in the nucleon from lattice QCD