The Role of Thermodynamics in the Activity and Selectivity of Antimicrobial Peptides