Heat the oil in a large pot over medium heat. Add the onion and a pinch of salt and cook until soft and lightly browned around the edges, 8 to 10 minutes, reducing the heat to low as needed.With the heat on low, add the garlic, ginger, curry powder, and red pepper flakes and cook, stirring, until fragrant, about 2 minutes.Add the tomatoes, lentils, water, coconut milk, ½ teaspoon salt, and several grinds of black pepper. Bring to a boil, cover, and reduce to a simmer, stirring only occasionally, until the lentils are tender, 25 to 35 minutes. If your soup is too thick, stir in ½ to 1 cup more water to reach your desired consistency.Stir in the cilantro and lime juice. Season to taste and serve.