improved server-side thread safety for in-memory persistence, closes #9