fix(pid): add a lock to ensure one agent is running