Merge pull request #97 from mannol1/master

Fixes and stuff...
Add checks for pthreads to the build system

pthreads are now required, so add appropriate checks to the build system
and set the compile flags accordingly.

closes #98
Merge pull request #99 from jin-eld/issue#98

Add checks for pthreads to the build system
Fix toxic build when toxav is not available
Merge pull request #100 from jin-eld/fix-noav

Fix toxic build when toxav is not available
Fixed incorrectly handled error check for longchars
Merge pull request #102 from graboy/master

Incorrectly handled error check for widechars
Open devices when call starts instead of keeping them opened all the time