Openly gay former sheriff wins Texas governor nomination