Saudi Arabia’s King Salman replaced top military leaders, promoted others and assigned new younger officials to economic and security roles.