It seems to work without the guard as well. The connect_proxy function is called four times here, but it's the same on Linux and Windows and in either way, the search toolbar item still works after re-ordering.
Since we cannot reproduce this anymore and the "fix" is so long ago, maybe it was really related to some Windows-GTK2 bugginess.