Resolving the plasmid paradox: costs and benefits of horizontal gene transfer in a community context