Joint Chiefs nominee wins over lawmakers but faces uncertain