test: add pthread test from contrib's pthread version