Pr/sockets

- Clean-up atomics code
- Fix an issue with atomic_op recv
- Fix warnings with gcc 4.9.2