Evolution of kleptoparasitism as a war of attrition