Synchronization mechanism in stats updating changed. IO stats merged into global stats.

To provide thread-safety during stats updates we use ```atomic_t``` type.
On platforms where it is possible it uses  ```__sync_add_and_fetch```.
When this option is not supported, it uses simple lock to assure atomic updates.