Fix possible segfault in IOThread::interrupt()

Thread executing the run() method could set m_handle to zero after the
check in IOThread::interrupt(), causing a crash in pthread_kill called
with null handle.

Mutex m_handleLock now guards access to m_handle. The common logic was
moved into IOThread::run() that calls virtual method execute(), which is
to be implemented in subclasses instead of QThread::run().
Merge pull request #21 from xhaakon/iothread-segfault

Fix possible segfault in IOThread::interrupt()