Atomicity of tuna_stats operations

Towards #11