Duplication and concerted evolution in a master sex determiner under balancing selection