fixed wrong use of errno in error conditions after a call to a pthread function
Merge pull request #102 from MarcelNehring/errnopthread

Fixed wrong use of errno in error conditions after a call to a pthread function