python: fix typo in lock management