fix the checking of GTK with XIM support on different OSs, such as FreeBSD