core: Machine updates state cache when querying state