Viscous shock-layer solutions with nonequilibrium chemistry for hypersonic flows past slender bodies