Large spin Hall magnetoresistance and its correlation to the spin-orbit torque in W/CoFeB/MgO structures