fix bug with thread destruction
Merge branch 'imod' of https://github.com/qmule/libed2k into imod