Second messenger–mediated tactile response by a bacterial rotary motor