[sc-memory] Fix error with invalid state on memory restart (issue #81)