core: clean up machine directory when id = nil