widgets: check if thread is valid before running pthread_cancel
widgets: check if thread is valid before running pthread_cancel

Fixes segfault when widget shared objects are missing.

jhanssen/candybar,Lokaltog/candybar,jhanssen/candybar,Lokaltog/candybar