I expect that since Secretary Gates is currently scheduled to continue on as SoD in the Obama cabinet, he'll be the designated survivor and will not show up at the inauguration. Gates doesn't need to be reconfirmed, so he'll provide the necessary continuity of government.
In addition to that, there have been numerous examples of a cabinet Secretary staying in office a few days into the term of a new President until his nominated successor is confirmed. Most often it's been the Secretary of State, although the ast time that happened for Secretary of State was in 1913 when Taft's Secretary of State Philander Chase Knox remained in office until March 5, 1913 when Wilson's SoS William Jennings Bryan was confirmed. Indeed the Taft/Wilson transition appears to be the last time any of the cabinet chose to hang around an extra day or two with the succeeding president being of the opposite party (Taft's Secretary of the Treasury also stayed an extra day.) However several of Reagan's Secretaries remained a few days until GHWB's nominees took office.
*BUMP*
I think this points the way to a solution to the original question. The OP is suggesting there must be some strict, highly technical solution to the situation discussed. The above history, however, suggests that the system is actually very flexible and adaptable. So, a highly technical and legalistic view may be the wrong one.