Workaround crash bug in libXi <= 1.4.1 (thanks, Steve!).

Fixes Bugzilla #1812.