core: lock around machine actions