India's top court has struck down a colonial-era law that makes homosexual acts punishable by up to 10 years in prison.