InMemoryStateRepository is thread-safe now