Add the missing locked() interface.

threading.Lock has a little known locked() method, documented in
https://docs.python.org/2.6/library/thread.html#thread.lock.locked

This method is not very useful, but since pthreading.Lock must be
drop-in replacment for threading.Lock, we must implement it.

This patch adds the missing method, implementing it in the same way
Python implemnts it.  Since RLock does not have this method, RLock does
not extend Lock now.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>