JsonWriter, make threadsafe with mutex, closes #9