Increased competition as a cost of specialization during the evolution of resource polymorphism