Propagation of torsional waves in an inhomogeneous layer over an inhomogeneous half-space