Prevent crash from unplugging tablet
We are aware that this is not a "good fix", but only a "at least it doesn't crash" fix. The good fix is GTK+3 which has hotplugging and we are obviously not going to implement hotplugging in GTK+2. Still at least we should prevent crash when we can (and here we can). A similar commit had been accepted in the past (commit 8368de2b) on the gtk-2-24 branch.
My 2 patches were just attached in #1052 and not getting any love, so here they are again as a merge request. :-)