liblock: switch to pthread locking api

While trying to integrate liblock into different programs for testing it out,
I understood that I've probably made a mistake using the kernel's locking
api instead of the pthread one. My reasons are:

 - This library is for userspace developers writing userspace code, they know
how pthread api works, they don't care how the kernel one does.
 - Using the same api makes it easier to switch to liblock in an existing
project.
 - Deal with errors returned from pthread functions.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>