Add pthread_mutex_init prototype
Fix trylock, it should be non-blocking. Implement lock.