use new lock context manager to aquire locks while cleaning up stale ones