core: make use of a lockfile for operations