Ab Initio Approach to Second-order Resonant Raman Scattering Including Exciton-Phonon Interaction