Faster locking constructs for python2.x