Adds test for riot threads.

The test uses riot threads to calculate the factorial of 12,
with one thread for each multiplication. The core mutex is
used for synchronization.
Merge pull request #757 from josephnoir/add_test_thread_factorial

tests: Add test for riot thread