Only build the thread code if multithreading is enabled

This allows including the source file in the build even if
multithreading isn't desired.
Move the WelsThreadLib files to the common directory/library

This simplifies building the thread library code via the
makefile based build system.
Merge pull request #182 from mstorsjo/move-threadlib

Move the WelsThreadLib files to the common directory/library