Democrats returned Representative Nancy Pelosi of California to the House speakership on Sunday for what may be her final term, handing a tested leader control of the slimmest majority in almost two decades as Washington prepares for a new Democratic president.