Representative Hilda L. Solis of California won confirmation as President Obama’s labor secretary, giving the agency a decidedly pro-worker tilt.