Foote, Thomas, Soldier at Tangier