Captain Thomas Willett, Mayor of New York