Influence of Reputation on Resistance against Bad Agents in the Iterated Prisoner’s Dilemma