Finishing up socket tests and thread tests.  Added mutex for pthread's.