Sensex, Nifty close higher driven by financial, pharma stocks