Dual role of DNA intrinsic curvature and flexibility in determining nucleosome stability