How the British did everything to keep Indians away from the civil services—yet failed