control/core.c: Fix a warning about lock being an usunsed variable, by using lock.