CA-138452: [UnitTest] Tests for cleanup.SR.lock

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-138452: Fix SR locking

If lock acquisition failed, SR._locked would still report that one lock
is acquired, thus leaving the SR object in an inconsistent state.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-138452: Merged into xs64bit

GitHub: closes #218 on xapi-project/sm