If a U.S. president dies while running for a second term, the situation can be complex