Use atomic accesses for potentially concurrent writes (closes #140) Closes #140 See merge request !187