Coinfection and the Evolution of Resistance: A Mathematical Analysis