Challenging a fellow Democrat, Senator Kirsten E. Gillibrand, is one possibility that William C. Thompson Jr. could pursue after exiting office as New York City’s comptroller.