Perfect and near-perfect adaptation in a model of bacterial chemotaxis