De Garnerin, Maximilian Joseph, active 1803-1861, Count of Montgelas and Count München, Bavarian foreign minister