Optimal Sex Allocation in Plants and the Evolution of Monoecy