In a pair of rulings, the court expanded the president’s ability to fire officials at agencies with purview over things like nuclear technology and consumer safety, while preserving the independence of the Federal Reserve.