City life 'boosts bug resistance'