India’s latest ban against gay sex has its origin in a five-century-old British power struggle