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.
Remove unused typedefs
Merge pull request #182 from mstorsjo/move-threadlib

Move the WelsThreadLib files to the common directory/library
Merge pull request #183 from mstorsjo/remove-unused-typedef

Remove unused typedefs