Adds test for pthread.

The test uses pthread to calculate the factorial of 12, with one
thread for each multiplication. pthread_mutex is used for synchronization.
Merge pull request #756 from josephnoir/add_test_pthread_factorial

tests: Add test for pthread