Effect of lattice anharmonicity on superconductivity