Add NULL check for gdk_quartz_event_get_nsevent().

I don't know why but it returns NULL on the canvas of Inkscape.
Anyway return value should always be checked.