Ab initio study of lattice dynamics of CsH2PO4 and CsD2PO4 crystals