Bacterial flagellar switching under load