Use a more portable cursor-hiding mechanism

This one appears to work on Linux-X11 and on OS X.