widgets: cancel threads on interrupt signals and window reloads

TODO threads need to have cleanup handlers attached to free resources
when the cancel signal is sent.
waf: add debug build options