Carter was the longest-lived US president - an outcome that seemed unlikely back in 2015 when he revealed he had brain cancer.