Bulk and surface contributions to second-order susceptibility in crystalline and porous silicon by second-harmonic generation