Indian markets snap 3-day losing streak, Nifty closes at 23,412