Ab initio calculation of nonlinear optical properties for chiral carbon nanotubes. Second harmonic generation and dc-Pockels effect