After more than a year of negotiations, Italy acquired the portrait by Caravaggio, which has long been privately owned.