Foreign investors poured $39 billion into India when the economy was at its worst