Patrick Shanahan will succeed James Mattis as defence secretary on 1 January – earlier than expected.