Stabilization of ballooning modes with sheared toroidal rotation