Working on pthread mutex

Cleaning up old ulocks code and bringin up C thread and pthread
locks.

Still missing signals which is going to be a problem.