Added locking.py, which I forgot to do 2 commits ago.