Fix a wrong lock, spotted by Andreas