Influence of magnetic shear on the lower-hybrid-drift instability in toroidal reversed-field pinches