Voters tend to select the other party when a lawmaker leaves Congress under a cloud.