Pope Francis came so close to death at one point during his 38-day fight in hospital against pneumonia that his doctors considered ending treatment so he could die in peace, the head of the pope's medical team said.