Propagation of torsional waves in an inhomogeneous layer sandwiched between inhomogeneous semi-infinite strata