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 replacement for threading.Lock, we must implement it.

This patch adds the missing method, implementing it in the same way
Python implements it.  Since RLock does not have this method, RLock does
not extend Lock now.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>