Python 3 compatibility for lockfile.py.