Hazard fixes.

- change from unsigned int to std::size_t reference counter.
- make hazard_count a constant instead of a function.
Memory ordering fixes.