Simplify GTK+ 2 version checks with a helper function. See https://github.com/wxWidgets/wxWidgets/pull/614