Doria Pamphili, Giuseppe, Cardinal, Papal Sec of State